AVars parsing bug or limitation
|
03-28-2024, 07:06 AM
(This post was last modified: 03-28-2024 08:54 AM by komame.)
Post: #10
|
|||
|
|||
RE: AVars parsing bug or limitation
(12-17-2023 10:02 PM)ab3ap Wrote: Thank you, Piotr, I will give it a try right after sending this. It sounds perfect and many thanks for finding a better solution! Mike, I found an even better solution, completely independent of the formatting settings and digit grouping in HOME. Code: import cas As you can see, instead of using hpprime.eval, I used cas.caseval. This allows parsing to be done on the CAS side, which handles all numerical cases perfectly. There's no need to even specify the output format (%.11f); simple conversion through str is sufficient. numToAvars('v',val) → val stored in AVars "v" variable examples: Code: numToAvars('v',123e+3) → 123000 Additionally, positive and negative infinity values are also supported: Code: numToAvars('v',float('inf')) → +Inf I think it's time to update your Prime Python page Piotr Kowalewski |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
AVars parsing bug or limitation - ab3ap - 11-14-2023, 04:08 PM
RE: AVars parsing bug or limitation - komame - 11-30-2023, 06:09 AM
RE: AVars parsing bug or limitation - ab3ap - 11-30-2023, 02:01 PM
RE: AVars parsing bug or limitation - ab3ap - 11-30-2023, 02:46 PM
RE: AVars parsing bug or limitation - Albert Chan - 11-30-2023, 03:31 PM
RE: AVars parsing bug or limitation - ab3ap - 11-30-2023, 03:58 PM
RE: AVars parsing bug or limitation - ab3ap - 12-01-2023, 01:43 PM
RE: AVars parsing bug or limitation - komame - 12-16-2023, 08:04 PM
RE: AVars parsing bug or limitation - ab3ap - 12-17-2023, 10:02 PM
RE: AVars parsing bug or limitation - komame - 03-28-2024 07:06 AM
RE: AVars parsing bug or limitation - ab3ap - 03-28-2024, 12:13 PM
|
User(s) browsing this thread: 2 Guest(s)