From b2250c70bd107d5553d3f5e8d756092f2589ad65 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 17 May 2007 21:52:11 +0000 Subject: 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. --- newlib/libm/math/w_atan2.c | 27 --------------------------- newlib/libm/math/wf_atan2.c | 25 ------------------------- 2 files changed, 52 deletions(-) (limited to 'newlib/libm') 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 -- cgit v1.2.3