Ask Your Question
1

Syntax error with power function

asked 8 years ago

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

Preview: (hide)

Comments

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

ndomes gravatar imagendomes ( 8 years ago )

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

tmonteil gravatar imagetmonteil ( 8 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 8 years ago

slelievre gravatar image

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 .

Preview: (hide)
link

Comments

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

kcrisman gravatar imagekcrisman ( 8 years ago )

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: 8 years ago

Seen: 312 times

Last updated: Sep 09 '16