Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

n() is N() -- they're different names for exactly the same function, so they'll give exactly the same answers.. at least if n and N are still what they started as.

Could you cut and paste the output that shows they're different? Usually when something like this happens, either (1) a function has been replaced, say because someone typed "n = something_or_other", or (2) there's a simple typo.

(BTW, your code confuses me a little-- you assign to xll twice but print N(ll), where ll is never defined.)

n() is N() -- they're different names for exactly the same function, so they'll give exactly the same answers.. at least if n and N are still what they started as.

Could you cut and paste the output that shows they're different? Usually when something like this happens, either (1) a function has been replaced, say because someone typed "n = something_or_other", or (2) there's a simple typo.

(BTW, your code confuses me a little-- you assign to xll twice but print N(ll), where ll is never defined.)

UPDATE: Thanks for posting the traceback. That makes it clear that my guess #1 was right: you've accidentally set n, little n, to a real number. Type "print n" to see what the number is. The error message is saying that a RealLiteral can't be called (which makes sense, it's not really a function.)

For example:

sage: n(pi)
3.14159265358979
sage: n = 3.45 
sage: n(pi)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Applications/sage/local/lib/python2.6/site-packages/sage/all_cmdline.pyc in <module>()
[...]
TypeError: 'sage.rings.real_mpfr.RealLiteral' object is not callable

n() is N() -- they're different names for exactly the same function, so they'll give exactly the same answers.. at least if n and N are still what they started as.

Could you cut and paste the output that shows they're different? Usually when something like this happens, either (1) a function has been replaced, say because someone typed "n = something_or_other", or (2) there's a simple typo.

(BTW, your code confuses me a little-- you assign to xll twice but print N(ll), where ll is never defined.)

UPDATE: Thanks for posting the traceback. That [Although it's not the output from the code you posted -- the capitalization in 'Little n next' is different between the two, so you must've changed something.]

The traceback makes it clear that my guess #1 was right: you've accidentally set n, little n, to a real number. Type "print n" to see what the number is. The error message is saying that a RealLiteral can't be called (which makes sense, it's not really a function.)

For example:

sage: n(pi)
3.14159265358979
sage: n = 3.45 
sage: n(pi)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Applications/sage/local/lib/python2.6/site-packages/sage/all_cmdline.pyc in <module>()
[...]
TypeError: 'sage.rings.real_mpfr.RealLiteral' object is not callable