Data transfers from the network are much slower than from main memory and even slower than from hard disk.
divide()
with negatives
Division with negative values works as with primitive int
s (and as with paper-and-pencil arithmetic).
Two positive operands give a positive result. A single negative operand, either in numerator or denominator, gives a negative result. Two negative operands give a positive result.
+num.divide( +div ) == +result | -num.divide( +div ) == -result |
-num.divide( -div ) == +result | +num.divide( -div ) == -result |
Of course, you are eager to practice this right away! Mentally (or with scratch paper) decide on the value of each expression. Then click on the button to see the correct value.
Expression | ? | Result |
---|---|---|
System.out.println( p12.divide( p3 ) ); | ||
System.out.println( n12.divide( p3 ) ); | ||
System.out.println( p12.divide( n3 ) ); | ||
System.out.println( n12.divide( n3 ) ); |
Using primitive int
s, what is 5%3
?