Wednesday, October 29, 2014

Question about Doubles?


Scanner scan = new Scanner(System.in);

double val = scan.nextDouble();

System.out.println(val - 11.5);


Why is the output 56.397000000000000006 instead of 67.897?


Thanks



No comments:

Post a Comment