Ask Your Question

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

asked 2013-06-29 19:32:56 +0200

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

answered 2013-06-29 20:13:38 +0200

dazedANDconfused gravatar image

updated 2013-06-29 22:46:33 +0200

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


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 21:24:51 +0200 )edit

Yes. I attached a picture to my answer.

dazedANDconfused gravatar imagedazedANDconfused ( 2013-06-29 22:47:08 +0200 )edit

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-30 03:54:01 +0200 )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


Asked: 2013-06-29 19:32:56 +0200

Seen: 1,583 times

Last updated: Jun 29 '13