Can someone please explain in detail why in Python 2.7
10.3 % 2.5 => 0.3
and in Python 3.0 prints 0.3000000000000007
(probably due to representation issues)
And, moreover, 10.3 % 2.5 - 0.3
prints 7.216449660063518e-16
in both Pythons.
The error I can imagine that is due to float representation, but why the change in print behavior and what can be done to avoid it when converting programs from 2 to 3?