The Department of Computer Science & Engineering
|
|
STUART C. SHAPIRO: CSE
115 C
|
double, and its wrapper class is java.lang.Double.e" and then by an integer.| Operator | Meaning |
|---|---|
+ | addition or unary plus |
- | subtraction or unary minus |
* | multiplication |
/ | division |
% | modulus (remainder) |
See java.lang.Math for some functions provided by the Java library.
for (double x = .1; x <= 1.; x += .1)
{System.out.println(x);}
==0.3 == 0.2 + 0.1Math.abs(0.3 - (0.2 + 0.1)) < .005
2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2.0 2.0+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16 2.0+(2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16) 2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2.0 == 2.0+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16+2e-16