Ask Your Question
1

TypeError: 'sage.rings.integer.Integer' object is not callable

asked 2014-04-28 12:48:35 +0100

Caterpillar gravatar image

I tried to enter into notebook:

a=-2

(-((a-1)^2)-((-a-8)(2(a-1))))/((a-1)^4)

And I obtained error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_13.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -- coding: utf-8 --\n" + _support_.preparse_worksheet_cell(base64.b64decode("KC0oKGEtMSleMiktKCgtYS04KSgyKGEtMSkpKSkvKChhLTEpXjQp"),globals())+"\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module> File "/tmp/tmpF91cWI/___code___.py", line 3, in <module> exec compile(u'(-((a-_sage_const_1 )_sage_const_2 )-((-a-_sage_const_8 )(_sage_const_2 (a-_sage_const_1 ))))/((a-_sage_const_1 )_sage_const_4 ) File "", line 1, in <module> TypeError: 'sage.rings.integer.Integer' object is not callable

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-04-28 13:53:38 +0100

kcrisman gravatar image

Yup! That's because 2(a-1) does not make sense in Sage. If you had defined f(x)=2+x or something, f(a-1) would be legal.

However, since you were probably trying to do implicit multiplication (as opposed to explicit 2*(a-1)), there is another option. You can turn on implicit multiplication if you wish. But beware - it is fragile! Good luck.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-04-28 12:48:35 +0100

Seen: 9,051 times

Last updated: Apr 28 '14