Mostowski Collapse <burse...@gmail.com> writes: > I also get: > > Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54) >>>> 2.718281828459045**0.8618974796837966 > 2.367649 > > Nice try, but isn't this one the more correct? > > ?- X is 2.718281828459045**0.8618974796837966. > X = 2.3676489999999997. >
That's probably the accuracy of the underlying C implementation of the exp function. In [25]: exp(0.8618974796837966) Out[25]: 2.367649 But even your answer can be improved: Maxima: (%i1) fpprec:30$ (%i2) bfloat(2.718281828459045b0)^bfloat(.8618974796837966b0); (%o2) 2.36764899999999983187397393143b0 but: (%i7) bfloat(%e)^bfloat(.8618974796837966b0); (%o7) 2.3676490000000000085638369695b0 surprisingly closer to Python's answer. but 2.718281828459045 isn't e. Close but no cigar. (%i10) bfloat(2.718281828459045b0) - bfloat(%e); (%o10) - 2.35360287471352802147785151603b-16 Fricas: (1) -> 2.718281828459045^0.8618974796837966 (1) 2.3676489999_999998319 (2) -> exp(0.8618974796837966) (2) 2.3676490000_000000086 -- Pieter van Oostrum <pie...@vanoostrum.org> www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list