[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Non-finite number I/O (was: Possible numbers bug)
From: |
John Cowan |
Subject: |
Re: [Chicken-users] Non-finite number I/O (was: Possible numbers bug) |
Date: |
Sat, 28 May 2011 16:59:56 -0400 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
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 <address@hidden>
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
- Re: [Chicken-users] Possible numbers bug, (continued)
- Re: [Chicken-users] Possible numbers bug, Christian Kellermann, 2011/05/27
- Re: [Chicken-users] Possible numbers bug, John Cowan, 2011/05/27
- Re: [Chicken-users] Possible numbers bug, Panos Stergiotis, 2011/05/27
- Re: [Chicken-users] Possible numbers bug, Kon Lovett, 2011/05/27
- Re: [Chicken-users] Possible numbers bug, Matt Welland, 2011/05/27
- Re: [Chicken-users] Possible numbers bug, Kon Lovett, 2011/05/27
- Re: [Chicken-users] Possible numbers bug, David N Murray, 2011/05/27
- Re: [Chicken-users] Possible numbers bug, Matt Welland, 2011/05/28
- Re: [Chicken-users] Possible numbers bug, Peter Bex, 2011/05/28
- Re: [Chicken-users] Possible numbers bug, Matt Welland, 2011/05/28
- Re: [Chicken-users] Non-finite number I/O (was: Possible numbers bug),
John Cowan <=
- Re: [Chicken-users] Possible numbers bug, Felix, 2011/05/30
Re: [Chicken-users] Possible numbers bug, Peter Bex, 2011/05/29