+ 5
This code sometimes doesn't work and it prints out something like 0.1999999999996$ instead of 0.20$ Please help!
6 Respostas
+ 10
https://javarevisited.blogspot.com/2012/02/java-mistake-1-using-float-and-double.html?m=1
Ok, here is the explaination.
+ 9
Lol yes that bcs of Amazing floats. Use round instead.
+ 7
Or why dont you make it an integer, and divide it when outputing it?
+ 3
What do you mean I should use Rounds? I'm sorry if I'm dumb but Im not sure what round is.
+ 3
Thanks for the help, I will change it soon! :D
+ 3
It's done now!