[Free42] Numbers reformatted in program mode
|
07-23-2018, 03:25 PM
Post: #9
|
|||
|
|||
RE: [Free42] Numbers reformatted in program mode
(07-23-2018 08:21 AM)Paul Dale Wrote: With BCD coded reals, there is no digit conversion required Yes, and that's why the HP-42S can store numbers that way and still be fast. It's not as easy with base-10000 or BID, though! (07-23-2018 08:21 AM)Paul Dale Wrote: It must have been fun dealing with binary floating point numbers and decimal fractions that change the number. 0.1 being converted to 0.1000000000000000055511151231257827021181583404541015625 when stored as an IEEE 64 bit number. I guess digits after the 12th can be rounded away which gives a solution. While I was still supporting PalmOS, and therefore unable to use the Standard C Library, it was a pain. After dropping PalmOS, the code became a lot simpler: Code: sprintf(decstr, "%.15e", d); followed by the existing logic to massage the string representation to match the HP-42S display modes. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
[Free42] Numbers reformatted in program mode - ijabbott - 07-22-2018, 10:33 AM
RE: [Free42] Numbers reformatted in program mode - Didier Lachieze - 07-22-2018, 11:03 AM
RE: [Free42] Numbers reformatted in program mode - Thomas Okken - 07-22-2018, 03:24 PM
RE: [Free42] Numbers reformatted in program mode - Werner - 07-23-2018, 07:27 AM
RE: [Free42] Numbers reformatted in program mode - ijabbott - 07-22-2018, 04:40 PM
RE: [Free42] Numbers reformatted in program mode - Thomas Okken - 07-22-2018, 05:40 PM
RE: [Free42] Numbers reformatted in program mode - ijabbott - 07-23-2018, 07:37 AM
RE: [Free42] Numbers reformatted in program mode - Paul Dale - 07-23-2018, 08:21 AM
RE: [Free42] Numbers reformatted in program mode - Thomas Okken - 07-23-2018 03:25 PM
|
User(s) browsing this thread: 1 Guest(s)