Re:0.30000000000000004
by mrcactu5 on Sunday April 02, 2017 @03:36PM
(#14018616)
I haven't seen it yet... what's with that final four (common to all languages)?
[ Parent
| on HN ]
Floats can only represent fractions of powers of two. 0.3 is a fraction of powers of two and five.
See IEEE754
> See IEEE754
Only in the original 1985 version, however: IEEE 754-2008 actually specifies decimal floating point types; decimal arithmetic was already specified in IEEE 854-1987. Of course, the default representation is almost always one of the binary formats, but that is no longer the only option.