c3d / db48x

RPL runtime for the DM42 calculator, in the spirit of HP48/49/50
http://48calc.org
GNU Lesser General Public License v3.0
85 stars 10 forks source link

Stack left dirty in case of error #278

Open camillew opened 1 year ago

camillew commented 1 year ago

The stack is left with some intermediary data in case of error:

8 0 / -> 1 [and an error] 8 0 MOD -> +NaN [and an error]

It would be great to have a behavior similar to the RPL calculators where the arguments were restored in case of error.

c3d commented 1 year ago

This behavior will "appear" when I get to implementing the undo stack and LastX.

Until then, you are correct that the state of the stack in case of error is not guaranteed.