0

Why print(0.1*3) 0.30000000000000004

21st Jul 2016, 8:12 AM
SeventhBoy
SeventhBoy - avatar
2 Answers
+ 1
Computers use floatibg point math. Its a very involved tooic, but here is a good reference: http://0.30000000000000004.com/ You can use a rounding function to help minimize the problem.
21st Jul 2016, 5:53 PM
mister bigs
mister bigs - avatar
0
thanks
21st Jul 2016, 9:45 PM
SeventhBoy
SeventhBoy - avatar