1remquo(3) Library Functions Manual remquo(3)
2
3
4
6 remquo, remquof, remquol - remainder and part of quotient
7
9 Math library (libm, -lm)
10
12 #include <math.h>
13
14 double remquo(double x, double y, int *quo);
15 float remquof(float x, float y, int *quo);
16 long double remquol(long double x, long double y, int *quo);
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 remquo(), remquof(), remquol():
21 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
22
24 These functions compute the remainder and part of the quotient upon di‐
25 vision of x by y. A few bits of the quotient are stored via the quo
26 pointer. The remainder is returned as the function result.
27
28 The value of the remainder is the same as that computed by the remain‐
29 der(3) function.
30
31 The value stored via the quo pointer has the sign of x / y and agrees
32 with the quotient in at least the low order 3 bits.
33
34 For example, remquo(29.0, 3.0) returns -1.0 and might store 2. Note
35 that the actual quotient might not fit in an integer.
36
38 On success, these functions return the same value as the analogous
39 functions described in remainder(3).
40
41 If x or y is a NaN, a NaN is returned.
42
43 If x is an infinity, and y is not a NaN, a domain error occurs, and a
44 NaN is returned.
45
46 If y is zero, and x is not a NaN, a domain error occurs, and a NaN is
47 returned.
48
50 See math_error(7) for information on how to determine whether an error
51 has occurred when calling these functions.
52
53 The following errors can occur:
54
55 Domain error: x is an infinity or y is 0, and the other argument is not
56 a NaN
57 An invalid floating-point exception (FE_INVALID) is raised.
58
59 These functions do not set errno.
60
62 For an explanation of the terms used in this section, see at‐
63 tributes(7).
64
65 ┌────────────────────────────────────────────┬───────────────┬─────────┐
66 │Interface │ Attribute │ Value │
67 ├────────────────────────────────────────────┼───────────────┼─────────┤
68 │remquo(), remquof(), remquol() │ Thread safety │ MT-Safe │
69 └────────────────────────────────────────────┴───────────────┴─────────┘
70
72 C11, POSIX.1-2008.
73
75 glibc 2.1. C99, POSIX.1-2001.
76
78 fmod(3), logb(3), remainder(3)
79
80
81
82Linux man-pages 6.04 2023-03-30 remquo(3)