Hacker News new | ask | show | jobs
by adaml_623 5030 days ago
Perhaps you could prove your point by supplying 0.1 in a binary floating point format. You can choose the standard.
3 comments

The parent is referring to an interval, since floating point is essentially a disguised interval arithmetic.

For IEEE754 64-bit doubles, the interval containing 0.1 is: [0.099999999999999991673327315311, 0.100000000000000005551115123126]

Sure adaml_623,

0x3dcccccd in IEEE 754-2008 (binary32) corresponds to the interval (0.09999999776482582, 0.10000000521540642) - which contains 0.1.

Disclaimers: I worked this out with double precision, and if you care about if the endpoints are inclusive/exclusive, the wikipedia article will help.

X \elem S is not the same as X == S, in many important contexts.
Agreed. I "proved my point" but I didn't do it "by supplying 0.1 in a binary floating point format", because that wasn't what my point was.
People often forget that IEEE 754 supports representations where b = 2 or 10. 1*10^-2 should be easy enough to store in any of the defined decimal layouts.