Ask Your Question
0

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

asked 2014-04-28 05:48:35 -0600

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
2

answered 2014-04-28 06:53:38 -0600

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 05:48:35 -0600

Seen: 2,054 times

Last updated: Apr 28 '14