Again Multiple Precision
There is the famous
Ramanujan constant exp(pi sqrt(163)) which is very close to the integer 640320^3+744
One has to be careful when doing computations with computers:
Mathematica:
N[Exp[Pi Sqrt[163]]-640320*640320*640320-744]
-480
which is nonsense but
Mathematica:
N[Exp[Pi Sqrt[163]]-640320^3-744,1]
-7.10^-13
works. Again, Wolfram support tells that this is intended as equating N[x] as N[x,16] for
example would be a performance hit. It is not a surprise that Python does give a similar
nonsense number as Python has no multiple precision built in.
python:
>>> from math import sqrt, exp, pi
>>> exp(pi*sqrt(163))-640320**3-744
-488.0
With mpmath, one gets
python:
from math import sqrt, exp, pi
from mpmath import mp
mp.dps=40
mp.exp(mp.pi*mp.sqrt(163))-640320**3-744
mpf('-0.00000000000074992....')
Also Pari, by default gives
pari:
>>> exp(pi*sqrt(163))-640320*640320*640320-744
-488.0
Also Sage, by default
exp(pi*sqrt(163))-640320*640320*640320-744
-480.000000
which is the same mysterious -480 as mathematica.