ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 17 Jan 2012 18:29:55 +0100Is n() the same as N() if not why nothttps://ask.sagemath.org/question/8635/is-n-the-same-as-n-if-not-why-not/I am trying to use Sage as a simple numerical calculator but sometimes have to fight with more advanced features, things I think are number are not. I starting using n() to fix this up, but in some cases it did not work. Bug big N N() did. Is this the way it is supposed to be ( if so why ). Identical commands ( symbols..... ) except for capitilization seems like a bad idea. Here is the code:
# Is n() the same as N() if not why not
xll = 1. / ( pi * ( 2. ^ .5 ) )
xll = 22. * 2
print "xll is of type", type( xll )
print ""
print "Big N next"
print N( ll )
print ""
print "Little n next"
print n( xll )
produced output:
xll is of type <type 'sage.rings.real_mpfr.RealNumber'>
Big N next
0.0000120042175487614
Little N next
Traceback (click to the left of this block for traceback) ...
TypeError: 'sage.rings.real_mpfr.RealLiteral' object is not callableruss_henselTue, 17 Jan 2012 18:29:55 +0100https://ask.sagemath.org/question/8635/