chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] expt incorrect in boundary cases


From: John Cowan
Subject: [Chicken-users] expt incorrect in boundary cases
Date: Tue, 28 Apr 2009 11:14:46 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

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 pow
would Do The Right Thing.

I found this when exhaustively checking the boundary cases for abs, acos,
asin, atan (1-arg and 2-arg versions), ceiling, cos, exp, expt, floor, log,
round, sin, sqrt, and tan.  All the others are correct.

-- 
John Cowan        http://ccil.org/~cowan   address@hidden
Lope de Vega: "It wonders me I can speak at all.  Some caitiff rogue did
rudely yerk me on the knob, wherefrom my wits still wander."
An Englishman: "Ay, a filchman to the nab betimes 'll leave a man
crank for a spell." --Harry Turtledove, Ruled Britannia




reply via email to

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