Make the answer a whole number.
transcript
A build needs a third of a minute. That is point three three three. Real numbers never end. Whole numbers do. Let me show you how.
Count in hundredths of a minute. Scale every input to it. Keep the check in integers. Now no rounding error can enter. Test one value that needs rounding. A third of a minute is a good one.
At thirty-three, the work is point nine nine. Not enough for one job. At thirty-four, it is one point oh two. That passes. The first true is thirty-four. No rounding function was needed.
Floats drift. Add point oh one a hundred times. The sum is not exactly one. Whole hundredths never drift. Integers are exact.
Scale every input to the unit. Five over two hundred fifty is zero. Five hundred over two hundred fifty is two. Mixed units pass small tests.
Choose the unit. Check in integers. Test one value that needs rounding. Full breakdown in the lecture.