I'm using the modulus operator and I'm get some floating point errors. For example,
>>> 7.2%3
1.2000000000000002
Is my only recourse to handle this by using the round
function? E.g.
>>> round(7.2%3, 1)
1.2
I don't a priori know the number of digits I'm going to need to round to, so I'm wondering if there's a better solution?