-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.0
-
x86
-
windows_nt
###@###.### (Mat Nelson)
Description:
I was writing an applet that starts with a float value of 0.0 and repeatedly adds .1 to it. Occasionally java would add .09999 or .10001 instead. Here is the source to reproduce the problem
0class DemonstrateFloatProblem p public static void main(String argsPP) p float x 0 0.00 for (int i 0 00i010000i ) p System.out.println(x)0 x 0 x .10 or x 0 .1 p pp
Error Message:
(well... here is some of the output I get...)...7.57.67.77.799997.899997.999998.099998.28.3...
Description:
I was writing an applet that starts with a float value of 0.0 and repeatedly adds .1 to it. Occasionally java would add .09999 or .10001 instead. Here is the source to reproduce the problem
0class DemonstrateFloatProblem p public static void main(String argsPP) p float x 0 0.00 for (int i 0 00i010000i ) p System.out.println(x)0 x 0 x .10 or x 0 .1 p pp
Error Message:
(well... here is some of the output I get...)...7.57.67.77.799997.899997.999998.099998.28.3...