Python modulus result is incorrect:
363.12 % 7.12
7.119999999999999
The result should be 0. Why is this?
Python modulus result is incorrect:
363.12 % 7.12
7.119999999999999
The result should be 0. Why is this?
"Unfortunately, most decimal fractions cannot be represented exactly as binary fractions. A consequence is that, in general, the decimal floating-point numbers you enter are only approximated by the binary floating-point numbers actually stored in the machine."
by Python Docs: Floating Point Arithmetic: Issues and Limitations