How can I floor a number to the nearest multiple of 0.2 in numpy?
For example, I have this:
0.2 * np.floor(xi / 0.2)
It works most of the time e.g.
>>> xi = 9.4
>>> 0.2 * np.floor(xi / 0.2)
9.4
However, it fails for some numbers, such as 9.6
>>> xi = 9.6
>>> 0.2 * np.floor(xi / 0.2)
9.4
I would expect the previous calculation to return 9.4.
How can I fix this?