chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] CR: expt should signal error on domain error


From: John Cowan
Subject: Re: [Chicken-hackers] CR: expt should signal error on domain error
Date: Fri, 17 Jun 2011 12:56:46 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

Felix scripsit:

> Why is floating-point zero not zero?

When it is the result of computational underflow.

> Should "(zero? 0.0)" be everything but true? Should "(zero?
> (exact->inexact 0))" be false?  Should "(= 0.0 0.0)" be false?

No to all three questions.

> Sure, numeric representation always meets a limit, but there must be
> some determinism, somewhere.

Agreed.  The whole point of +inf.0, -inf.0, and +nan.0 is that they
provide determinism, unlike exceptions.

> This is totally inconsistent. Even though the IEEE numeric model seems
> to be the de-facto standard I don't see why a high-level language
> should go out of its way just to follow this model because the
> number-crunchers like it?

The whole point of providing inexact numbers is to do number crunching.
I have spent a 30+ year career in programming without ever using flonums
in anger, except in languages like Basic, Perl, Lua, and JavaScript
where they are the only kind of number provided.

But those who do want them, want IEEE behavior, not only simply because
it's a standard, but because it's a standard that actually provides
desirable behavior.

-- 
John Cowan                              <address@hidden>
            http://www.ccil.org/~cowan
                .e'osai ko sarji la lojban.
                Please support Lojban!          http://www.lojban.org



reply via email to

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