1 /* e_remainderf.c -- float version of e_remainder.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
4 * $FreeBSD: src/lib/msun/src/e_remainderf.c,v 1.5 1999/08/28 00:06:38 peter Exp $
5 * $DragonFly: src/lib/msun/src/Attic/e_remainderf.c,v 1.2 2003/06/17 04:26:53 dillon Exp $
9 * ====================================================
10 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
12 * Developed at SunPro, a Sun Microsystems, Inc. business.
13 * Permission to use, copy, modify, and distribute this
14 * software is freely granted, provided that this notice
16 * ====================================================
20 #include "math_private.h"
23 static const float zero = 0.0;
25 static float zero = 0.0;
30 float __ieee754_remainderf(float x, float p)
32 float __ieee754_remainderf(x,p)
46 /* purge off exception values */
47 if(hp==0) return (x*p)/(x*p); /* p = 0 */
48 if((hx>=0x7f800000)|| /* x not finite */
49 ((hp>0x7f800000))) /* p is NaN */
53 if (hp<=0x7effffff) x = __ieee754_fmodf(x,p+p); /* now x < 2p */
54 if ((hx-hp)==0) return zero*x;
63 p_half = (float)0.5*p;
70 SET_FLOAT_WORD(x,hx^sx);