News for hackers. Stuff that matters.
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)?
Re:0.30000000000000004 by nitrogen on Sunday April 02, 2017 @03:41PM (#14018644)
Floats can only represent fractions of powers of two. 0.3 is a fraction of powers of two and five.

See IEEE754

https://en.m.wikipedia.org/wiki/IEEE_floating_point

https://en.m.wikipedia.org/wiki/IEEE_754-1985

Re:0.30000000000000004 by mmarx on Sunday April 02, 2017 @06:00PM (#14019284)
> 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.