HP Forums

Full Version: Reproducible crash with badly defined function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everybody,

just for the notes if someone puts this in some bug tracker: The following procedure which I did accidently reproducibly crashes my HP Prime G2 with current firmware:

1) In CAS, with no previous Answer (no 'Ans'), type Ans² and store this as f(x)
2) Compute f(2) or thelike

My Prime either told me that it had a problem and would restart, or it restarts without a message, or the display is complete garbage and the calculator hangs (and can be revived using the Reset hole on its back side).

Happy_crashing ;-)
Stefan
CAS> f := x -> Ans^2 // Ans = f
CAS> f(2)                   // = f^2 = (x->f^2)^2 = (x->(x->f^2))^2 ..., causing crash

If the goal is to write a thunk to square Ans, we can use indirection, CAS.Ans instead of Ans

CAS> f := NULL -> CAS.Ans^2
CAS> f() // no argument needed, no crash
(program({},{},(double_deux_points(CAS,Ans))^2))^2
(program({},{},(double_deux_points(CAS,Ans))^2))^4
(program({},{},(double_deux_points(CAS,Ans))^2))^8

CAS> 10
CAS> f()
100
10000
100000000
Hello Albert,

Thanks for your posting. Don't worry, I don't have any problem. I _accidently_ entered that. I wanted to store x² as the function, but forgot to press x before pressing x². That way, Ans² was produced and I just didn't notice. I just wanted to report that that brought the calculator to crash or reboot. Thanks again!

Best Regards,
Stefan
(11-07-2022 07:50 PM)Stefan Falk Wrote: [ -> ]Hello everybody,

Hello, Stefan!

Quote:… just for the notes if someone puts this in some bug tracker…

Thanks for posting. I’ve managed to recreate the experience here and have created a ticket for it in “some bug tracker”. :-)

(If anyone reading this would like an account on the bug tracker I’ve set up to help organize matters, just let me know by PM.)
Hello jte,

Great! Thank you!

Best Regards,
Stefan
Reference URL's