4 ms·
According to Google 999999999999999 – 999999999999998 = 0
- Bino 10y agoShould a hacker be surprised by floating point math?
- tsukikage 10y agoThis actually is quite surprising. If you play around, you quickly discover the epsilon does not correspond to any standard mantissa sizes. In fact, Google appear to represent numbers to a precision of 1 part in 333333333333333: https://www.google.co.uk/search?q=333333333333334+-+333333333333333 https://www.google.co.uk/search?q=333333333333334+-+33333333... and all smaller positive successive integer pairs yield 1 https://www.google.co.uk/search?q=333333333333335+-+333333333333334 https://www.google.co.uk/search?q=333333333333335+-+33333333... and all larger positive successive integer pairs yield 0 what the hell kind of numeric representation does that?
- deleted 10y ago[deleted]
- Cereal 10y agoeven 999999999999999 - 999999999999997 = 0 instead using 999999999999996 it return the correct result.