diff options
author | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2018-12-06 16:14:01 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-01-23 10:46:24 +0100 |
commit | b14a879d85b171960df789ac8ba2332004f838e0 (patch) | |
tree | 532dd01e4a882b5cf7d50ad237082574c01e67f6 /newlib/libm/math/w_scalb.c | |
parent | 1f10a00ba717b22b154205508e60af0dcb641ed3 (diff) | |
download | newlib-b14a879d85b171960df789ac8ba2332004f838e0.zip newlib-b14a879d85b171960df789ac8ba2332004f838e0.tar.gz newlib-b14a879d85b171960df789ac8ba2332004f838e0.tar.bz2 |
Remove matherr, and SVID and X/Open math library configurations
Default math library configuration is now IEEE
Diffstat (limited to 'newlib/libm/math/w_scalb.c')
-rw-r--r-- | newlib/libm/math/w_scalb.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/newlib/libm/math/w_scalb.c b/newlib/libm/math/w_scalb.c index c324968..77fb2af 100644 --- a/newlib/libm/math/w_scalb.c +++ b/newlib/libm/math/w_scalb.c @@ -47,42 +47,17 @@ SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */ #endif - struct exception exc; z = __ieee754_scalb(x,fn); if(_LIB_VERSION == _IEEE_) return z; if(!(finite(z)||isnan(z))&&finite(x)) { - /* scalb overflow; SVID also returns +-HUGE_VAL */ - exc.type = OVERFLOW; - exc.name = "scalb"; - exc.err = 0; - exc.arg1 = x; - exc.arg2 = fn; - exc.retval = x > 0.0 ? HUGE_VAL : -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - if (exc.err != 0) - errno = exc.err; - return exc.retval; + /* scalb overflow */ + errno = ERANGE; + return (x > 0.0 ? HUGE_VAL : -HUGE_VAL); } if(z==0.0&&z!=x) { /* scalb underflow */ - exc.type = UNDERFLOW; - exc.name = "scalb"; - exc.err = 0; - exc.arg1 = x; - exc.arg2 = fn; - exc.retval = copysign(0.0,x); - 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 copysign(0.0,x); } #ifndef _SCALB_INT if(!finite(fn)) errno = ERANGE; |