2 /* @(#)w_remainder.c 5.1 93/09/24 */
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7 * Developed at SunPro, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
11 * ====================================================
16 <<rint>>, <<rintf>>, <<remainder>>, <<remainderf>>---round and remainder
28 double rint(double <[x]>);
29 float rintf(float <[x]>);
30 double remainder(double <[x]>, double <[y]>);
31 float remainderf(float <[x]>, float <[y]>);
39 double remainder(<[x]>,<[y]>)
41 float remainderf(<[x]>,<[y]>)
45 <<rint>> and <<rintf>> returns their argument rounded to the nearest
46 integer. <<remainder>> and <<remainderf>> find the remainder of
47 <[x]>/<[y]>; this value is in the range -<[y]>/2 .. +<[y]>/2.
50 <<rint>> and <<remainder>> return the integer result as a double.
53 <<rint>> and <<remainder>> are System V release 4. <<rintf>> and
54 <<remainderf>> are extensions.
59 * wrapper remainder(x,p)
65 #ifndef _DOUBLE_IS_32BITS
68 double remainder(double x
, double y
) /* wrapper remainder */
70 double remainder(x
,y
) /* wrapper remainder */
75 return __ieee754_remainder(x
,y
);
79 z
= __ieee754_remainder(x
,y
);
80 if(_LIB_VERSION
== _IEEE_
|| isnan(y
)) return z
;
84 exc
.name
= "remainder";
89 if (_LIB_VERSION
== _POSIX_
)
91 else if (!matherr(&exc
)) {
102 #endif /* defined(_DOUBLE_IS_32BITS) */