Reproducible crash with badly defined function
|
11-07-2022, 09:14 PM
Post: #2
|
|||
|
|||
RE: Reproducible crash with badly defined function
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 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Reproducible crash with badly defined function - Stefan Falk - 11-07-2022, 07:50 PM
RE: Reproducible crash with badly defined function - Albert Chan - 11-07-2022 09:14 PM
RE: Reproducible crash with badly defined function - Stefan Falk - 11-08-2022, 07:44 AM
RE: Reproducible crash with badly defined function - jte - 01-07-2023, 02:40 AM
RE: Reproducible crash with badly defined function - Stefan Falk - 01-07-2023, 08:34 AM
|
User(s) browsing this thread: 1 Guest(s)