Per Modern Treasury's own explanation of why floats fail for currency, IEEE-754 floating-point numbers represent values in binary — powers of two — while money is inherently decimal. That mismatch means most monetary values simply can't be represented exactly in a float. Their example: storing $2.78 as a float doesn't actually store 2.78. It decomposes into powers of two and lands on the closest approximation it can reach — 2.7799999913897705078125. Close, but not equal. Only values that happen to be exact powers of two, like $0.50 or $16.00, escape this problem.
A 1 kilogram silver bar, the kind of product whose price recalculates continuously against live spot and weight
Photo: Gilded Bullion
Top comments (0)