3 ms·
Python doesn't return the remainder from floor division, but that's why the modulo operator was invented: >>> 4//0.4 9.0 >>> 4%0.4 0.3999999999999998
by Doxin 7y ago
Python doesn't return the remainder from floor division, but that's why the modulo operator was invented:
>>> 4//0.4
9.0
>>> 4%0.4
0.3999999999999998
It does look to be a problem with float precision.