Ask Your Question
2

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

asked 2013-06-29 12:32:56 -0500

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
4

answered 2013-06-29 13:13:38 -0500

dazedANDconfused gravatar image

updated 2013-06-29 15:46:33 -0500

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

edit flag offensive delete link more

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 ( 2013-06-29 14:24:51 -0500 )edit

Yes. I attached a picture to my answer.

dazedANDconfused gravatar imagedazedANDconfused ( 2013-06-29 15:47:08 -0500 )edit
3

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

Eviatar Bach gravatar imageEviatar Bach ( 2013-06-29 20:54:01 -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: 2013-06-29 12:32:56 -0500

Seen: 578 times

Last updated: Jun 29 '13