diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 47d5eda38..d2ed17ffe 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2007-05-17 Cary R. yahoo.com> + + * 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. + 2007-05-17 Yaakov Selkowitz users.sourceforge.net> * libm/common/Makefile.am: Add support for exp10, exp10f, diff --git a/newlib/libm/math/w_atan2.c b/newlib/libm/math/w_atan2.c index 25eb1617e..f3e344ea6 100644 --- a/newlib/libm/math/w_atan2.c +++ b/newlib/libm/math/w_atan2.c @@ -60,8 +60,6 @@ RETURNS $-\pi$ to $\pi$. @end tex -If both <[x]> and <[y]> are 0.0, <> causes a <> error. - You can modify error handling for these functions using <>. PORTABILITY @@ -86,32 +84,7 @@ PORTABILITY double y,x; #endif { -#ifdef _IEEE_LIBM return __ieee754_atan2(y,x); -#else - double z; - struct exception exc; - z = __ieee754_atan2(y,x); - if(_LIB_VERSION == _IEEE_||isnan(x)||isnan(y)) return z; - if(x==0.0&&y==0.0) { - /* atan2(+-0,+-0) */ - exc.arg1 = y; - exc.arg2 = x; - exc.type = DOMAIN; - exc.name = "atan2"; - exc.err = 0; - exc.retval = 0.0; - if(_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - errno = EDOM; - } - if (exc.err != 0) - errno = exc.err; - return exc.retval; - } else - return z; -#endif } #endif /* defined(_DOUBLE_IS_32BITS) */ diff --git a/newlib/libm/math/wf_atan2.c b/newlib/libm/math/wf_atan2.c index 069a7ca13..eb2a76b1f 100644 --- a/newlib/libm/math/wf_atan2.c +++ b/newlib/libm/math/wf_atan2.c @@ -28,32 +28,7 @@ float y,x; #endif { -#ifdef _IEEE_LIBM return __ieee754_atan2f(y,x); -#else - float z; - struct exception exc; - z = __ieee754_atan2f(y,x); - if(_LIB_VERSION == _IEEE_||isnanf(x)||isnanf(y)) return z; - if(x==(float)0.0&&y==(float)0.0) { - /* atan2f(+-0,+-0) */ - exc.arg1 = y; - exc.arg2 = x; - exc.err = 0; - exc.type = DOMAIN; - exc.name = "atan2f"; - exc.retval = 0.0; - if(_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - errno = EDOM; - } - if (exc.err != 0) - errno = exc.err; - return (float)exc.retval; - } else - return z; -#endif } #ifdef _DOUBLE_IS_32BITS