1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +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

@ -35,8 +35,9 @@ static char rcsid[] = "$NetBSD: w_fmod.c,v 1.6 1995/05/10 20:48:55 jtc Exp $";
double z;
z = __ieee754_fmod(x,y);
if(_LIB_VERSION == _IEEE_ ||__isnan(y)||__isnan(x)) return z;
if(y==0.0) {
return __kernel_standard(x,y,27); /* fmod(x,0) */
if(__isinf(x)||y==0.0) {
/* fmod(+-Inf,y) or fmod(x,0) */
return __kernel_standard(x,y,27);
} else
return z;
#endif