gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-infinity and REPRESENT


From: Anton Ertl
Subject: -infinity and REPRESENT
Date: Mon, 4 May 2020 17:24:07 +0200
User-agent: NeoMutt/20170113 (1.7.2)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]