What’s the binary representation of 1/12th?
Hint: it is an infinite string in binary, just like it is in decimal, because it has a factor of 3.
In decimal, only fractions with a factor of 2 or 5 can be represented with terminating decimals.
In binary, only fractions with a factor of 2 can be represented with a terminating…uh, decimal.
That means fractions of 1/12 can’t be represented in binary exactly, just like fractions of 1/10th. 1/3 also can’t be represented exactly in binary. 1/12th is not a dyadic measure.
Again, all this can be mitigated by finding the smallest unit you’re going to keep track of, and calling that 1 unit, and doing all your calculations as integer multiples of that unit. Just like in the metric shop, don’t use fractions of a centimeter, use millimeters, and then your problems of inexact representations of floating point decimals are over.
And this is why, as Nava says, nobody is going to input 10ths of a centimeter. If the smallest length you care about is 1/10th of a centimeter, you’re going to instead input integer millimeters rather than fractions of a centimeter.
Yes, there is no way to precisely divide by 10 on a binary system. There is also no way to precisely divide by 3, 5, 7, 11, or any other value that is not 2^n. If you’re dividing by 2^n, you’re golden. Anything else, be careful.