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.7182818284590450907955982984276488423347
On Mon, Oct 18, 2010 at 3:54 AM, gerrob wrote:
> What am I doing in a wrong way?
There are two differences.
1) In the .py file, there is no preparsing so the "1" in the function
is of type "int" rather than Integer. This only causes a problem with
#2.
2) You are not importing the exp function