-infinity and REPRESENT
Anton Ertl <anton-8NJIiSa5LzB3ZGU3T6kWFyEcasqEdqbRs2V0tQ3P5b8@public.gmane.org> Mon, 4 May 2020 17:24:07 +0200
| Newsgroups | gmane.comp.lang.forth.gforth |
|---|---|
| Message-ID | <[email protected]> |
I just re-implemented REPRESENT. One issue is how to deal with -infinity (e.g., the result of -1e 0e f/). Previously Gforth 0.7.2+glibc produced "-inf" and f1=0 (positive), f2=0 (not valid); other libc implementations might lead to different results. gforth 0.7.9_20200423 uses an ecvt_r supplied by us and produces "-inf" and f1=-1 (negative), f2=0 (not valid); the new REPRESENT currently works in the same way (except that it gives you "-infinity", space permitting). In both systems F. and FS. outputs -in. iForth behaves like gforth 0.7.2. VFX produces "Inf" and f1=-1, f2=0. The VFX behaviour looks like the most sensible one to me, but it might affect code that uses REPRESENT; we can change our own code accordingly, but what about your code? Do you have code that uses REPRESENT and that has been designed for a specific behaviour when getting -infinity? - anton