diff options
Diffstat (limited to 'newlib/libm/math/w_log10.c')
-rw-r--r-- | newlib/libm/math/w_log10.c | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/newlib/libm/math/w_log10.c b/newlib/libm/math/w_log10.c index 3b436d539..69ef5f92c 100644 --- a/newlib/libm/math/w_log10.c +++ b/newlib/libm/math/w_log10.c @@ -61,7 +61,6 @@ PORTABILITY return __ieee754_log10(x); #else double z; - struct exception exc; z = __ieee754_log10(x); if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; if(x<=0.0) { @@ -71,35 +70,15 @@ PORTABILITY SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */ #endif - exc.name = "log10"; - exc.err = 0; - exc.arg1 = x; - exc.arg2 = x; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; if(x==0.0) { - /* log10(0) */ - exc.type = SING; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } + /* log10(0) */ + errno = ERANGE; + return -HUGE_VAL; } else { - /* log10(x<0) */ - exc.type = DOMAIN; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - errno = EDOM; - } - exc.retval = nan(""); - } - if (exc.err != 0) - errno = exc.err; - return exc.retval; + /* log10(x<0) */ + errno = EDOM; + return nan(""); + } } else return z; #endif |