Taking this code to sage/combinat/combinat.py file:
def digits_of_e(n):
from sage.misc.functional import exp
from sage.rings.real_mpfr import RealNumber, RealField
R=RealField(n)
print R(exp(1))
and trying it gives:
sage: digits_of_e(300)
2.71828182845904509079559829842764884233474731445312500000000000000000000000000000000000000
which is clearly wrong, after the decimal point only 15 digits are
correct.
But works on sage notebook when I type exactly the same code or even:
sage: R=RealField(300)
sage: R(exp(1))
2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138218
What am I doing in a wrong way?
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org