1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
10 float remquof(float x
, float y
, int *quo
) /* wrapper remquof */
12 float remquof(x
,y
,quo
) /* wrapper remquof */
17 int signx
, signy
, signres
;
22 GET_FLOAT_WORD(wx
, x
);
23 GET_FLOAT_WORD(wy
, y
);
25 signx
= (wx
& 0x80000000) >> 31;
26 signy
= (wy
& 0x80000000) >> 31;
28 signres
= (signx
^ signy
) ? -1 : 1;
30 x_over_y
= fabsf(x
/ y
);
32 *quo
= signres
* (lrintf(x_over_y
) & 0x7f);
34 return remainderf(x
,y
);
37 #ifdef _DOUBLE_IS_32BITS
40 double remquo(double x
, double y
, int *quo
) /* wrapper remquof */
42 double remquo(x
,y
,quo
) /* wrapper remquof */
47 return (double) remquof((float) x
, (float) y
, quo
);
50 #endif /* defined(_DOUBLE_IS_32BITS) */