HP Forums

Full Version: Storing and recalling CAS quoted expressions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the CAS, if I do
Code:
a:='2+2'

does a now store 4 or '2+2'? Is there a way of telling? If the latter, is there a way of recalling the original '2+2' rather than 4?
(10-21-2018 01:29 PM)BruceH Wrote: [ -> ]In the CAS, if I do
Code:
a:='2+2'

does a now store 4 or '2+2'? Is there a way of telling? If the latter, is there a way of recalling the original '2+2' rather than 4?

Hi,

I'm not sure but it seems that:
1 - a:='2+2' stores 4
2 - a:="2+2" stores the string 2+2
I believe any simple evaluations such as basic math will be evaluated by the store operator. Anything more complex will not.
You can control evaluation with the second optional argument of eval.
For example a:='2+2' followed by eval(a,1) will return 2+2, assuming that auto-simplification level is 0.
Thanks Bernard.
Reference URL's