Ask Your Question
1

Why is Sage calling 1 a variable?

asked 2017-05-22 00:24:03 -0500

cybervigilante gravatar image

updated 2017-05-23 13:16:36 -0500

Consider

x = var('x') 
f = 1/(x-3) 

limit(f,x=3,dir='below')

UnboundLocalError: local variable 'l' referenced before assignment

edit retag flag offensive close merge delete

Comments

I'm using preformat so I have no idea why the first two statements keep showing up on the same line, but they aren't

cybervigilante gravatar imagecybervigilante ( 2017-05-22 00:27:25 -0500 )edit

The error message is local variable 'l' referenced before assignment. It's variable l (small cap L), not 1. I have reported the issue on sage-dev.

David Coudert gravatar imageDavid Coudert ( 2017-05-22 02:09:25 -0500 )edit

Thanks for reporting.

tmonteil gravatar imagetmonteil ( 2017-05-22 05:42:30 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-05-22 01:55:09 -0500

mforets gravatar image

updated 2017-05-22 02:02:35 -0500

Try with limit(f, x=3, dir='minus').

I think this is a (trivial) bug, thanks for reporting. The code in question is in lines 1228-1245 of calculus.py.

Edit: this is #23048.

edit flag offensive delete link more

Comments

Thanks for fixing.

tmonteil gravatar imagetmonteil ( 2017-05-22 05:47:39 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-05-22 00:24:03 -0500

Seen: 59 times

Last updated: May 23