public class Test {
public static void main(String args[]) {
double d1 = 20000.01;
double d2 = 10000.01;
double d3 = d1 - d2;
System.out.prin tln(d3);
}
}
why does the above code return 9999.9999999999 98.
Is there any way to make it return 10000;
Nischal
public static void main(String args[]) {
double d1 = 20000.01;
double d2 = 10000.01;
double d3 = d1 - d2;
System.out.prin tln(d3);
}
}
why does the above code return 9999.9999999999 98.
Is there any way to make it return 10000;
Nischal
Comment