It's no "error" (ha) that you can't exactly represent 5/3 in base 2 number system - it can only represent numbers of the form (-1)^a*2^b*c for integer a,b,c. If you are trying to perform repeated calculations that accumulate some arithmetic error at every step, then ieee754 probably isn't the best data type for the task at hand. Fractional calculators (which allow exact representation of fractions like 5/3 without being limited by base or precision) or "constructive reals" - or simply keeping track of the numerator and comparing if the sum of the numerators is equal to the denominator - would avoid such issues. As another reply to my comment said, it is about using the right data type for the task, and float is a pretty good compromise between many different needs but isn't appropriate for literally everything.