H->HMS conversion HP-15C vs. HP42S vs HP67
|
09-12-2018, 02:08 PM
(This post was last modified: 09-13-2018 02:24 AM by Albert Chan.)
Post: #53
|
|||
|
|||
RE: H->HMS conversion HP-15C vs. HP42S vs HP67
(09-12-2018 07:06 AM)Werner Wrote: Why not (09-12-2018 07:14 AM)Werner Wrote: T := HMS*100; Correctly implemented strtod guaranteed maximum error 0.5 ULP Scaling by constant also guaranteed maximum error of 0.5 ULP So, scaled value can at most be 1 ULP below User Decimal Input (where 40 second bug might hit) Ideally, we want 1 ULP correction: nextafter(100*X, 200*X) X*100.00000000000001 might correct 1 to 2 ULP (due to rounding). But, (possible) 1 ULP over-correction is good enough. The patched version is also fast, same as un-patched version. Too big over-correction, however, may mis-interpret what the user entered. Both Pekis and Meyers "+25 seconds" patches have similar counter-examples: For negative angles, patches make it worse, say, X = -0.10, under-counted 40 seconds. For positive angles, 75+ seconds, it "fixed" a phantom bug, under-counted 40 seconds. Example: 85 seconds, both patches returned 0.0125 degree (= 45 seconds). The patches are not wrong, but limited (non-negative angles and no "bad" seconds). |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)