Right, so in both cases, there is no exact representation of that value in floating point so it is eventually rounded up.

I am going to add a check for the case where the fraction calculation rounds up leading to an increment in the integer value, so in your examples, the results would end up as "10" and "16".

Would this resolve the issue you are seeing?