Re: fuzzy rounding, roundoff, roundup(), et cetera.
John Denker via gnumeric-list <[email protected]> Sat, 10 Jul 2021 14:52:15 -0700
| Newsgroups | gmane.comp.gnome.apps.gnumeric |
|---|---|
| Message-ID | <[email protected]> |
I coded a version of roundup(xx, pp) It correctly handles all the tricky cases I know of, including: ru 0.24999999999999997 16 ru 0.1250000001000003 16 ru 0.49999999999999997 16 ru 0.1 -15 It comes with a test harness, and an updated preliminary specification, in my fpu_exceptions.c program. See the "ru" and "ruspec" commands in particular. Interested parties are invited to experiment with it. If you find a case that doesn't seem to be handled correctly, please let me know. https://www.av8n.com/cgit/FPU/tree/fpu_exceptions.c