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.
9 #ifndef _DOUBLE_IS_32BITS
12 double remquo(double x
, double y
, int *quo
) /* wrapper remquo */
14 double remquo(x
,y
,quo
) /* wrapper remquo */
19 int signx
, signy
, signres
;
24 GET_HIGH_WORD(mswx
, x
);
25 GET_HIGH_WORD(mswy
, y
);
27 signx
= (mswx
& 0x80000000) >> 31;
28 signy
= (mswy
& 0x80000000) >> 31;
30 signres
= (signx
^ signy
) ? -1 : 1;
32 x_over_y
= fabs(x
/ y
);
34 *quo
= signres
* (lrint(x_over_y
) & 0x7f);
36 return remainder(x
,y
);
39 #endif /* defined(_DOUBLE_IS_32BITS) */