1 /* e_remainderf.c -- float version of e_remainder.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
13 * ====================================================
16 #if defined(LIBM_SCCS) && !defined(lint)
17 static char rcsid
[] = "$NetBSD: e_remainderf.c,v 1.4 1995/05/10 20:46:08 jtc Exp $";
21 #include "math_private.h"
24 static const float zero
= 0.0;
26 static float zero
= 0.0;
31 float __ieee754_remainderf(float x
, float p
)
33 float __ieee754_remainderf(x
,p
)
47 /* purge off exception values */
48 if(hp
==0) return (x
*p
)/(x
*p
); /* p = 0 */
49 if((hx
>=0x7f800000)|| /* x not finite */
50 ((hp
>0x7f800000))) /* p is NaN */
54 if (hp
<=0x7effffff) x
= __ieee754_fmodf(x
,p
+p
); /* now x < 2p */
55 if ((hx
-hp
)==0) return zero
*x
;
64 p_half
= (float)0.5*p
;
71 SET_FLOAT_WORD(x
,hx
^sx
);