0
Java double number problem
why when i do 15.7 * 3 the output is 47.0999999999944 but in regular calculator it is 47.1?
2 Respostas
+ 3
Floating point numbers, including doubles, are just inaccurate when stored in computers.
+ 1
I'm guessing it's because the regular calculator did round the number, the double type is more precise on the fractals I suppose, hence the lengthy digits.