HP Forums
answer() cmd - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: answer() cmd (/thread-11551.html)



answer() cmd - compsystems - 10-08-2018 07:28 PM

Hello, in CAS mode (hp-prime) "Ans" cmd only operates with the first level =(. One way to work with CAS for beginners is to operate history levels.

for example, hp50 RPN
PHP Code:
'a+b=c'
'a' 
-
SIMPLIFY
returns
'b=c-a' 

xcas
PHP Code:
autosimplify(0):;
c;
ans(-1)-a
simplify(ans(-1))
b=c-

to emulate this situation, a new command is required, it can be called ans(#) (lowercase) that allows to call the specific input (history level)

a+b = c [enter] a+b = c
ans(1)-a [enter] a+b-a = c-a
simplify(ans(1)) [enter] b = c-a