diff options
Diffstat (limited to 'newlib/libm/math/w_fmod.c')
-rw-r--r-- | newlib/libm/math/w_fmod.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/newlib/libm/math/w_fmod.c b/newlib/libm/math/w_fmod.c index df11dc34c..678800053 100644 --- a/newlib/libm/math/w_fmod.c +++ b/newlib/libm/math/w_fmod.c @@ -43,8 +43,6 @@ magnitude of <[y]>. <<fmod(<[x]>,0)>> returns NaN, and sets <<errno>> to <<EDOM>>. -You can modify error treatment for these functions using <<matherr>>. - PORTABILITY <<fmod>> is ANSI C. <<fmodf>> is an extension. */ @@ -69,28 +67,12 @@ PORTABILITY return __ieee754_fmod(x,y); #else double z; - struct exception exc; z = __ieee754_fmod(x,y); if(_LIB_VERSION == _IEEE_ ||isnan(y)||isnan(x)) return z; if(y==0.0) { - /* fmod(x,0) */ - exc.type = DOMAIN; - exc.name = "fmod"; - exc.arg1 = x; - exc.arg2 = y; - exc.err = 0; - if (_LIB_VERSION == _SVID_) - exc.retval = x; - else - exc.retval = 0.0/0.0; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - errno = EDOM; - } - if (exc.err != 0) - errno = exc.err; - return exc.retval; + /* fmod(x,0) */ + errno = EDOM; + return 0.0/0.0; } else return z; #endif |