[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] CR: Division by inexact zero should return infinit
From: |
John Cowan |
Subject: |
Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan |
Date: |
Wed, 24 Aug 2011 19:03:44 -0400 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Peter Bex scripsit:
> I'm working on fixing several bugs in numbers, and now I stumbled upon
> Chicken's behaviour with zero-flonums:
>
> (/ 1. -1. 0.0 0.0) => error: division by zero
>
> However, an inexact zero is not exactly zero; it could be some very
> small value unrepresentable by the internal floating-point storage.
>
> This is really annoying, as you'd get "random" errors when you're
> working with numbers in the extreme ranges representable by flonums
> even if you absolutely know you're dividing by nonzero values.
I agree on all points, and have said so in the past.
> 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.
Currently, Chicken is the only Scheme in my usual list that provides
inexact infinity but signals an error when dividing by zero. See
http://trac.sacrideo.us/wg/wiki/Zero . Note that this page does not
show which Schemes actually provide infinities and NaNs, nor is it
necessarily up to date with the latest versions.
--
The first thing you learn in a lawin' family John Cowan
is that there ain't no definite answers address@hidden
to anything. --Calpurnia in To Kill A Mockingbird
- [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, Peter Bex, 2011/08/24
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan,
John Cowan <=
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, Felix, 2011/08/25
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, Peter Bex, 2011/08/25
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, Ivan Shmakov, 2011/08/25
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, Felix, 2011/08/25
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, Alex Shinn, 2011/08/25
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, Alaric Snell-Pym, 2011/08/25
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, Felix, 2011/08/25
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, John Cowan, 2011/08/25
- Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan, John Cowan, 2011/08/25