Ask Your Question
2

Perform arithmetic on previous answer/result, without copying/re-entering it?

asked 11 years ago

bxdin gravatar image

I enter the following in sage:

361-4*-216 #sage comment: I would like sqrt this without copying & pasting

I'd like to then obtain the sqrt of that answer after its been generated.

On the Ti-83 plus, the device was able to generate 'Ans' after I pressed an arithmetic symbol such as division.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
4

answered 11 years ago

dazedANDconfused gravatar image

updated 11 years ago

If you're in a notebook environment and type 361-4-216 into a cell and get the answer then in the cell underneath you would refer to the previous calculation using the _ symbol. So typing sqrt(_) will give you the square root of the calculation in the previous cell. I find it's easiest to assign calculations to variables, eg a=361-4-216, after which you can use the variable in other calculation easily. image description

Preview: (hide)
link

Comments

The underscore symbol? I tried that and got a TypeError message: Traceback (click to the left of this block for traceback) ... TypeError

bxdin gravatar imagebxdin ( 11 years ago )

Yes. I attached a picture to my answer.

dazedANDconfused gravatar imagedazedANDconfused ( 11 years ago )
3

This also works in the command-line version; the underscore holds the result of the last returned computation.

Eviatar Bach gravatar imageEviatar Bach ( 11 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

1 follower

Stats

Asked: 11 years ago

Seen: 1,672 times

Last updated: Jun 29 '13