tech-userlevel archive

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

Re: port-amd64/45391: pow(3) wrong result for x = 0.0 and y < 0



On Tue, Sep 08, 2015 at 04:13:33PM +0000, Taylor R Campbell wrote:
 >    Date: Tue, 8 Sep 2015 16:03:54 +0000
 >    From: David Holland <dholland-tech%netbsd.org@localhost>
 > 
 >    On Tue, Sep 08, 2015 at 08:41:55AM +0000, David Holland wrote:
 >     > Also, what's pow(+/-0, non-integer) supposed to produce?
 > 
 >    Erm, that was supposed to be "negative non-integer"...
 > 
 > IEEE 754-2008, Sec. 9.2.1 `Special values', p. 45:
 > 
 > > For the pow function (integral exponents get special treatment):
 > >     ...
 > >     pow(+/-0, y) is +infinity and signals the divideByZero exception for finite y<0 and not an odd integer

What our existing tests want is:

   pow(+0.0, -4.0) == +HUGE_VAL
   pow(-0.0, -4.0) == +HUGE_VAL
   pow(+0.0, -5.0) == +HUGE_VAL
   pow(-0.0, -5.0) == -HUGE_VAL
   pow(+0.0, -4.5) == (not checked)
   pow(-0.0, -4.5) == (not checked)

Before the commit I made last night, these all yield -HUGE_VAL. With
the commit, they all yield +HUGE_VAL. With the additional change I
proposed but didn't commit, the first four are as requested by the
existing tests, and the last two yield +HUGE_VAL.

I guess other than not signaling that's ok... maybe I should commit
that additional change after all. Although it's pretty gross. Or I
could revert the lot until someone has time to look at it more
carefully.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index