Hacker News new | past | comments | ask | show | jobs | submit login

Actually Wolfram|Alpha does give 1, but Mathematica 11.3 gives 2.



Mathematica interprets the real numbers 9999999999999999.0 and 9999999999999998.0 as having machine precision. To work in arbitrary precision, you need a backtick after the number, followed by the number of significant digits.

In this case,

9999999999999999.0`17-9999999999999998.0`17 does indeed return 1.

https://reference.wolfram.com/language/ref/Precision.html




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: