Ask Your Question

Syntax error with power function

asked 2016-09-08 13:03:31 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hello, I'm running sage on virtual box and changed the keyboard layout to german. It works well, except the ^-function leads to a syntax error. Sage recognizes the power by setting the power number high. Can you help me? Best regard, Henning

edit retag flag offensive close merge delete


How do you use Sage? Command line? Sage Notebook? What's your browser, editor?

ndomes gravatar imagendomes ( 2016-09-08 13:26:13 -0500 )edit

Does it work if you set the keyboard back to english ?

tmonteil gravatar imagetmonteil ( 2016-09-09 07:22:57 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2016-09-09 16:18:15 -0500

I think you mean that when you type x^2 you obtain , as if the circumflex ^ "eats" the 2 and turns it into a "superscript two", and then when you evaluate that with Sage you get a SyntaxError.

To avoid that, type a space after typing ^, as if you were typing x^ 2.

So you would be typing x followed by ^ followed by a space followed by 2.

Then you will get x^2.

Similarly, using a French keyboard, to get x^a we have to add in a space and type x^ a, otherwise we get .

edit flag offensive delete link more


Very interesting; that would be worth adding to the wiki about the virtualbox.

kcrisman gravatar imagekcrisman ( 2016-09-10 20:46:06 -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


Asked: 2016-09-08 13:03:31 -0500

Seen: 66 times

Last updated: Sep 09 '16