1remainder(3M) Mathematical Library Functions remainder(3M)
2
3
4
6 remainder, remainderf, remainderl - remainder function
7
9 c99 [ flag... ] file... -lm [ library... ]
10 #include <math.h>
11
12 double remainder(double x, double y);
13
14
15 float remainderf(float x, float y);
16
17
18 long double remainderl(long double x, long double y);
19
20
22 These functions return the floating point remainder r = x − ny when y
23 is non-zero. The value n is the integral value nearest the exact value
24 x/y. When |n − x/y| = ½, the value n is chosen to be even.
25
26
27 The behavior of remainder() is independent of the rounding mode.
28
30 Upon successful completion, these functions return the floating point
31 remainder r = x − ny when y is non-zero.
32
33
34 If x or y is NaN, a NaN is returned.
35
36
37 If x is infinite or y is 0 and the other is non-NaN, a domain error
38 occurs and a NaN is returned.
39
41 These functions will fail if:
42
43 Domain Error The x argument is ±Inf, or the y argument is ±0 and the
44 other argument is non-NaN.
45
46 If the integer expression (math_errhandling &
47 MATH_ERREXCEPT) is non-zero, then the invalid floating-
48 point exception is raised.
49
50 The remainder() function sets errno to EDOM if y argu‐
51 ment is 0 or the x argument is positive or negative
52 infinity.
53
54
56 An application wanting to check for error situations can set errno to 0
57 before calling remainder(). On return, if errno is non-zero, an error
58 has occurred. The remainderf() and remainderl() functions do not set
59 errno.
60
62 See attributes(5) for descriptions of the following attributes:
63
64
65
66
67 ┌─────────────────────────────┬─────────────────────────────┐
68 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
69 ├─────────────────────────────┼─────────────────────────────┤
70 │Interface Stability │Standard │
71 ├─────────────────────────────┼─────────────────────────────┤
72 │MT-Level │MT-Safe │
73 └─────────────────────────────┴─────────────────────────────┘
74
76 abs(3C), div(3C), feclearexcept(3M), fetestexcept(3M), attributes(5),
77 standards(5)
78
79
80
81SunOS 5.11 12 Jul 2006 remainder(3M)