diff options
Diffstat (limited to 'newlib/libm/mathfp/wf_jn.c')
-rw-r--r-- | newlib/libm/mathfp/wf_jn.c | 55 |
1 files changed, 7 insertions, 48 deletions
diff --git a/newlib/libm/mathfp/wf_jn.c b/newlib/libm/mathfp/wf_jn.c index ebc886de9..526027441 100644 --- a/newlib/libm/mathfp/wf_jn.c +++ b/newlib/libm/mathfp/wf_jn.c @@ -28,25 +28,12 @@ return jnf(n,x); #else float z; - struct exception exc; z = jnf(n,x); if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; if(fabsf(x)>(float)X_TLOSS) { /* jnf(|x|>X_TLOSS) */ - exc.type = TLOSS; - exc.name = "jnf"; - exc.err = 0; - exc.arg1 = (double)n; - exc.arg2 = (double)x; - exc.retval = 0.0; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - if (exc.err != 0) - errno = exc.err; - return exc.retval; + errno = ERANGE; + return 0.0f; } else return z; #endif @@ -63,10 +50,9 @@ return ynf(n,x); #else float z; - struct exception exc; z = ynf(n,x); if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; - if(x <= (float)0.0){ + if(x <= 0.0f){ /* ynf(n,0) = -inf or ynf(x<0) = NaN */ #ifndef HUGE_VAL #define HUGE_VAL inf @@ -74,40 +60,13 @@ SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */ #endif - exc.type = DOMAIN; /* should be SING for IEEE */ - exc.name = "ynf"; - exc.err = 0; - exc.arg1 = (double)n; - exc.arg2 = (double)x; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - errno = EDOM; - } - if (exc.err != 0) - errno = exc.err; - return (float)exc.retval; + errno = EDOM; + return (float)-HUGE_VAL; } if(x>(float)X_TLOSS) { /* ynf(x>X_TLOSS) */ - exc.type = TLOSS; - exc.name = "ynf"; - exc.err = 0; - exc.arg1 = (double)n; - exc.arg2 = (double)x; - exc.retval = 0.0; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - if (exc.err != 0) - errno = exc.err; - return (float)exc.retval; + errno = ERANGE; + return 0.0f; } else return z; #endif |