-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
when calculating these two numbers 5+0.56 out put is given as 5.5600000000000005.
It also happen when adding following numbers
6+0.56=6.5600000000000005
7+0.56=7.5600000000000005
ACTUAL -
5.5600000000000005
---------- BEGIN SOURCE ----------
class Example{
public static void main(String[] args){
double a=5.0;
double b=0.56;
double c=a+b;
System.out.println(c);
}
}
---------- END SOURCE ----------
FREQUENCY : always
when calculating these two numbers 5+0.56 out put is given as 5.5600000000000005.
It also happen when adding following numbers
6+0.56=6.5600000000000005
7+0.56=7.5600000000000005
ACTUAL -
5.5600000000000005
---------- BEGIN SOURCE ----------
class Example{
public static void main(String[] args){
double a=5.0;
double b=0.56;
double c=a+b;
System.out.println(c);
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8268940 Incorrect value of sum 2.0+0.9999 = 2.9999000000000002
- Closed