[Chicken-users] expt incorrect in boundary cases

2009-04-28 Thread John Cowan
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

Re: [Chicken-users] expt incorrect in boundary cases

2009-04-28 Thread fulvio ciriaco
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

Re: [Chicken-users] expt incorrect in boundary cases

2009-04-28 Thread John Cowan
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

Re: [Chicken-users] expt incorrect in boundary cases

2009-04-28 Thread Matthew Flatt
-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 >

Re: [Chicken-users] expt incorrect in boundary cases

2009-04-28 Thread John Cowan
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

Re: [Chicken-users] expt incorrect in boundary cases

2009-04-28 Thread Matthew Flatt
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

Re: [Chicken-users] expt incorrect in boundary cases

2009-04-28 Thread Will M Farr
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.

Re: [Chicken-users] expt incorrect in boundary cases

2009-04-28 Thread fulvio ciriaco
-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/