Name: sgC58550 Date: 03/14/97
public class fp {
public static void main(String argv[]) {
System.out.println(3 * 0.2);
System.out.println(0.6000000000000001);
System.out.println(0.6);
}
}
Run this program under JDK 1.0.2, and it prints all 0.6.
When run under JDK 1.1 *even if it was compiled under JDK 1.0.2*
The first two numbers are output as 0.6000...0001
company - Univ. of Calif. at Santa Barbara , email - ###@###.###
======================================================================
- duplicates
-
JDK-4036083 float rounding error in JDK1.1 and JDK 1.1.1
-
- Closed
-