2 /* @(#)w_fmod.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 <<fmod>>, <<fmodf>>---floating-point remainder (modulo)
25 double fmod(double <[x]>, double <[y]>)
26 float fmodf(float <[x]>, float <[y]>)
30 double fmod(<[x]>, <[y]>)
31 double (<[x]>, <[y]>);
33 float fmodf(<[x]>, <[y]>)
37 The <<fmod>> and <<fmodf>> functions compute the floating-point
38 remainder of <[x]>/<[y]> (<[x]> modulo <[y]>).
41 The <<fmod>> function returns the value
48 for the largest integer <[i]> such that, if <[y]> is nonzero, the
49 result has the same sign as <[x]> and magnitude less than the
52 <<fmod(<[x]>,0)>> returns NaN, and sets <<errno>> to <<EDOM>>.
54 You can modify error treatment for these functions using <<matherr>>.
57 <<fmod>> is ANSI C. <<fmodf>> is an extension.
67 #ifndef _DOUBLE_IS_32BITS
70 double fmod(double x
, double y
) /* wrapper fmod */
72 double fmod(x
,y
) /* wrapper fmod */
77 return __ieee754_fmod(x
,y
);
81 z
= __ieee754_fmod(x
,y
);
82 if(_LIB_VERSION
== _IEEE_
||isnan(y
)||isnan(x
)) return z
;
90 if (_LIB_VERSION
== _SVID_
)
94 if (_LIB_VERSION
== _POSIX_
)
96 else if (!matherr(&exc
)) {
107 #endif /* defined(_DOUBLE_IS_32BITS) */