PATCH: atan2 +0/-0 special case wrapper fixes

Cary R. cygcary@yahoo.com
Mon May 7 22:22:00 GMT 2007


The wrapper code for atan2 returns 0.0 and raises a domain error if both
arguments to atan2 are zero (ignoring the sign). Recent versions of glibc
return the result specified in the base atan2 functionality and explicitly
state that this (atan2(0,0), etc.) does not raise a domain error. This
patch removes all the special case code in the wrapper files since it is
not needed to get the same result as glibc. The documentation is also
updated to be consistent with these changes.

Here's something for the Changelog.

* libm/math/w_atan2.c: Fix atan2 to be consistent with glibc
(atan2(+0,-0), atan2(-0,-0) and atan(-0,+0))
* libm/math/wf_atan2.c: Ditto.

The patch and a test program are attached.

Cary


 
____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: atan2.patch
Type: application/octet-stream
Size: 1863 bytes
Desc: 3987802099-atan2.patch
URL: <http://sourceware.org/pipermail/newlib/attachments/20070507/3b6ccfa8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chk_atan2.c
Type: application/octet-stream
Size: 1024 bytes
Desc: 1898335329-chk_atan2.c
URL: <http://sourceware.org/pipermail/newlib/attachments/20070507/3b6ccfa8/attachment-0001.obj>


More information about the Newlib mailing list