chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] CR: Division by inexact zero should return infinit


From: Peter Bex
Subject: Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan
Date: Thu, 15 Sep 2011 12:58:08 +0200
User-agent: Mutt/1.4.2.3i

On Wed, Sep 07, 2011 at 10:01:52PM +0200, Peter Bex wrote:
> On Wed, Aug 24, 2011 at 09:18:44PM +0200, Peter Bex wrote:
> > All other Schemes I tested with (Guile, Gauche, Scheme48, Racket and Gambit)
> > return +inf.0 for (/ 1.0 0.0) and -inf.0 for (/ -1.0 0.0).
> > They return +nan.0 for (/ 0.0 0.0).  Extra data points would be welcome.
> > 
> > I'd like to open a CR for doing the same in Chicken, to make it behave
> > like a good little robot.  If it is accepted, a corresponding change will
> > also be made to the "numbers" egg.  The CR has ticket number #672 in Trac.
> > 
> 
> The voting process has now started.
> https://bugs.call-cc.org/ticket/672

The voting period is now over and this CR has been rejected, the main
reason being that core returns flonums when a number doesn't fit in a
fixnum and so you can get flonums when you don't expect it.  This will
cause one program to behave differently on division by zero depending
on the architecture it runs on.

Because numbers does not have this problem, I will probably switch the
numbers egg to return inf or nan on division by inexact zero.

If we ever change this behavior in core this issue might be voted on
again.  Until then, this issue is closed.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

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