According to IEEE 754, the four expressions (expt 1.0 +inf), (expt -1.0 +inf),
(expt 1.0 -inf), and (expt -1.0 -inf) should all return +nan. In Chicken they
all return 1.0 instead. This appears to be a bug in the ISO C definition
of the "pow" function. Checking for these four cases and bypassing
009
bui...@b6.netbsd.org:/home/builds/ab/netbsd-5-0-RC4/i386/200904142015Z-obj/home/builds/ab/netbsd-5-0-RC4/src/sys/arch/i386/compile/GENERIC
i386
Fulvio
From: John Cowan
Subject: [Chicken-users] expt incorrect in boundary cases
Date: Tue, 28 Apr 2009 11:14:46 -0400
> According to IEEE 754
fulvio ciriaco scripsit:
> No, not a bug with the definition. It depends on libm.
That's why I say it's a spec bug. The SUS specifies what libm does in
this case, and specifies the Wrong Thing. Or, if you like, there is a
conflict between specs.
If you think about it, multiplying -1 by itself
-lchicken => /home/fc/chicken/lib/libchicken.so
>
> NetBSD 5.0_RC4 NetBSD 5.0_RC4 (GENERIC) #0: Wed Apr 15 12:24:14 UTC 2009
> bui...@b6.netbsd.org:/home/builds/ab/netbsd-5-0-RC4/i386/200904142015Z-obj/home
> /builds/ab/netbsd-5-0-RC4/src/sys/arch/i386/compile/GENERIC i386
>
Matthew Flatt scripsit:
> For what it's worth,
>
> http://svn.plt-scheme.org/plt/trunk/src/mzscheme/sconfig.h
>
> contains a number of platform-specific, FP-related declarations that
> reflect how well different libms work in our experience. For example,
> POW_HANDLES_INF_CORRECTLY is declared
At Tue, 28 Apr 2009 13:43:38 -0400, John Cowan wrote:
> Matthew Flatt scripsit:
>
> > For what it's worth,
> >
> > http://svn.plt-scheme.org/plt/trunk/src/mzscheme/sconfig.h
> >
> > contains a number of platform-specific, FP-related declarations that
> > reflect how well different libms work i
On Apr 28, 2009, at 1:29 PM, John Cowan wrote:
or an even number; so NaN is a sensible response. I don't know what
the motivation for (expt 1.0 +inf) being NaN is.
I suspect that the reasoning is as follows: since 1.0 is inexact, it
could easily *mean* 0.9... or
1.
-users] expt incorrect in boundary cases
Date: Tue, 28 Apr 2009 11:55:32 -0600
> At Tue, 28 Apr 2009 13:43:38 -0400, John Cowan wrote:
>> Matthew Flatt scripsit:
>>
>> > For what it's worth,
>> >
>> > http://svn.plt-scheme.org/plt/trunk/src/mzscheme/