1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

* math/w_fmod.c: Also handle x=±Inf as error.

* math/w_fmodf.c: Likewise.
	* math/w_fmodl.c: Likewise.
	* math/libm-test.inc (fmod_test): Add tests for errno after calls for
	x=±Inf or y=0.
This commit is contained in:
Ulrich Drepper
2009-04-26 03:43:02 +00:00
parent 0c59a1963e
commit 7095366d1e
5 changed files with 22 additions and 8 deletions

View File

@ -39,8 +39,9 @@ static char rcsid[] = "$NetBSD: $";
long double z;
z = __ieee754_fmodl(x,y);
if(_LIB_VERSION == _IEEE_ ||__isnanl(y)||__isnanl(x)) return z;
if(y==0.0) {
return __kernel_standard(x,y,227); /* fmod(x,0) */
if(__isinfl(x)||y==0.0) {
/* fmodl(+-Inf,y) or fmodl(x,0) */
return __kernel_standard(x,y,227);
} else
return z;
#endif