Hi all,
I have found loss of precision of java program given below.
class DoubleValue
{
public static void main(String[] args)
{
double d1 = 83.7875;
double d2 = 70.0;
double d;
d = d1 - d2;
System.out.prin tln(d);
}
}
Instead of getting 13.7875, i got only 13.787499999999 994. Where im going to wrong?
Thanks in advance..
I have found loss of precision of java program given below.
class DoubleValue
{
public static void main(String[] args)
{
double d1 = 83.7875;
double d2 = 70.0;
double d;
d = d1 - d2;
System.out.prin tln(d);
}
}
Instead of getting 13.7875, i got only 13.787499999999 994. Where im going to wrong?
Thanks in advance..
Comment