Peter Bex scripsit:

> I think it's the same.  Only flonums can be +inf and hence the .0 is
> superfluous.

Superfluous, maybe, but now standard.  R6RS prescribes it (for systems
supporting IEEE floats) and so will R7RS-small, despite being much more
like R5RS in most ways.

Existing implementations use either +inf.0 or something specific to
that implementation.  Specifically: Racket, Gauche, Guile, Kawa, Chibi,
SCM, Ikarus, Larceny, IronScheme, Ypsilon, Mosh, and STklos all use
+inf.0.  Bigloo uses +Infinity.  Scheme48/scsh uses #{Inf}.  SISC uses
infinity.0, which is not even rereadable.  MIT Scheme and Scheme 9 do
not have non-finite values; they always report floating overflow or
divide by zero errors.  (Scheme 9 is non-IEEE; it handles flonums up to
10^10^10 - 1.)

What is more, Chicken is not even consistent: on Linux it prints +inf,
but on Cygwin, which uses Newlib instead of GNU libc, it prints +inf.0.

My recommendations:

Use wrapper logic in number->string to print +inf.0, -inf.0, and +nan.0
in the appropriate circumstances, and make sure that string->number
always accepts them.

Remove the divide-by-zero exception when dividing by inexact 0, which
does not represent a mathematical 0, but any number between the smallest
positive flonum and the largest negative flonum.

-- 
We do, doodley do, doodley do, doodley do,        John Cowan <[email protected]>
What we must, muddily must, muddily must, muddily must; 
Muddily do, muddily do, muddily do, muddily do,    http://www.ccil.org/~cowan
Until we bust, bodily bust, bodily bust, bodily bust.  --Bokonon

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to