3 ms·
> The floats are a surprisingly bad approximation of the reals. They're barely better than the integers They are integers. Each float is a pattern of 64 discre
by thaumasiotes 2y ago
> The floats are a surprisingly bad approximation of the reals. They're barely better than the integers
They are integers. Each float is a pattern of 64 discrete bits. Discretion means integers.
- kbolino 2y agoIn float32 land, if x = 0.5 (with bit pattern 0x3f000000) y = 0.25 (with bit pattern 0x3e800000) then x+y = 0.75 (with bit pattern 0x3f400000) But if we just added the bit patterns like integers, we would get 0x7d800000 (with a float value of over 10^37). Just because they are discrete doesn't mean they are integers only that they can be mapped one-to-one with integers. The bit pattern is not the semantic meaning of the value, and you cannot perform correct operations if you ignore the semantics.