1 /* origin: FreeBSD /usr/src/lib/msun/src/e_remainderf.c */
3 * 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 * ====================================================
18 float remainderf(float x, float p)
24 GET_FLOAT_WORD(hx, x);
25 GET_FLOAT_WORD(hp, p);
30 /* purge off exception values */
31 if (hp == 0 || hx >= 0x7f800000 || hp > 0x7f800000) /* p = 0, x not finite, p is NaN */
35 x = fmodf(x, p + p); /* now x < 2p */
40 if (hp < 0x01000000) {
54 GET_FLOAT_WORD(hx, x);
55 if ((hx & 0x7fffffff) == 0)
57 SET_FLOAT_WORD(x, hx ^ sx);