2 ms·
In Python: >>> 999999999999999 - 999999999999997 2L
by RyanMcGreal 17y ago
In Python:
>>> 999999999999999 - 999999999999997
2L
- swolchok 17y agoThe bug, in Python (needs more digits because Python's "float" is C's "double"): >>> float(999999999999999999) - float(999999999999999997) 0.0
- dreish 17y agoNot the same bug. Try chopping off a nine from each number, first in the above in Python, and then in the Google version.
- bfung 17y agoOut of curiosity... C:\>ruby --version ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] C:\>irb irb(main):001:0> 999999999999999 - 999999999999997 => 2 irb(main):002:0> 9999999999999999 - 9999999999999997 => 2 irb(main):003:0> 999999999999999.0 - 999999999999997.0 => 2.0 irb(main):004:0> 9999999999999999.1 - 9999999999999997.1 => 2.0