Hi,
Why does the following program display the value for 'g' as 113.99999999999
instead of 114? The program works fine with all the values except for 113,114,115. Can any body tell me what is wrong? It gives problem when I try to multiply by 100.
public class doubleString{
public static void main(
String[] args)
{
Double d = new Double(1.14);
double f = d.doubleValue();
System.out.println("f*100 = " + f);
double g= d.doubleValue()*100.0;
System.out.println("g ="+ g);
}
}