1REMQUO(3P) POSIX Programmer's Manual REMQUO(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 remquo, remquof, remquol — remainder functions
14
16 #include <math.h>
17
18 double remquo(double x, double y, int *quo);
19 float remquof(float x, float y, int *quo);
20 long double remquol(long double x, long double y, int *quo);
21
23 The functionality described on this reference page is aligned with the
24 ISO C standard. Any conflict between the requirements described here
25 and the ISO C standard is unintentional. This volume of POSIX.1‐2008
26 defers to the ISO C standard.
27
28 The remquo(), remquof(), and remquol() functions shall compute the same
29 remainder as the remainder(), remainderf(), and remainderl() functions,
30 respectively. In the object pointed to by quo, they store a value whose
31 sign is the sign of x/y and whose magnitude is congruent modulo 2n to
32 the magnitude of the integral quotient of x/y, where n is an implemen‐
33 tation-defined integer greater than or equal to 3. If y is zero, the
34 value stored in the object pointed to by quo is unspecified.
35
36 An application wishing to check for error situations should set errno
37 to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these
38 functions. On return, if errno is non-zero or fetestexcept(FE_INVALID |
39 FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has
40 occurred.
41
43 These functions shall return x REM y.
44
45 On systems that do not support the IEC 60559 Floating-Point option, if
46 y is zero, it is implementation-defined whether a domain error occurs
47 or zero is returned.
48
49 If x or y is NaN, a NaN shall be returned.
50
51 If x is ±Inf or y is zero and the other argument is non-NaN, a domain
52 error shall occur, and a NaN shall be returned.
53
55 These functions shall fail if:
56
57 Domain Error
58 The x argument is ±Inf, or the y argument is ±0 and the
59 other argument is non-NaN.
60
61 If the integer expression (math_errhandling & MATH_ERRNO)
62 is non-zero, then errno shall be set to [EDOM]. If the
63 integer expression (math_errhandling & MATH_ERREXCEPT) is
64 non-zero, then the invalid floating-point exception shall
65 be raised.
66
67 These functions may fail if:
68
69 Domain Error
70 The y argument is zero.
71
72 If the integer expression (math_errhandling & MATH_ERRNO)
73 is non-zero, then errno shall be set to [EDOM]. If the
74 integer expression (math_errhandling & MATH_ERREXCEPT) is
75 non-zero, then the invalid floating-point exception shall
76 be raised.
77
78 The following sections are informative.
79
81 None.
82
84 On error, the expressions (math_errhandling & MATH_ERRNO) and
85 (math_errhandling & MATH_ERREXCEPT) are independent of each other, but
86 at least one of them must be non-zero.
87
89 These functions are intended for implementing argument reductions which
90 can exploit a few low-order bits of the quotient. Note that x may be so
91 large in magnitude relative to y that an exact representation of the
92 quotient is not practical.
93
95 None.
96
98 feclearexcept(), fetestexcept(), remainder()
99
100 The Base Definitions volume of POSIX.1‐2008, Section 4.19, Treatment of
101 Error Conditions for Mathematical Functions, <math.h>
102
104 Portions of this text are reprinted and reproduced in electronic form
105 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
106 -- Portable Operating System Interface (POSIX), The Open Group Base
107 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
108 cal and Electronics Engineers, Inc and The Open Group. (This is
109 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
110 event of any discrepancy between this version and the original IEEE and
111 The Open Group Standard, the original IEEE and The Open Group Standard
112 is the referee document. The original Standard can be obtained online
113 at http://www.unix.org/online.html .
114
115 Any typographical or formatting errors that appear in this page are
116 most likely to have been introduced during the conversion of the source
117 files to man page format. To report such errors, see https://www.ker‐
118 nel.org/doc/man-pages/reporting_bugs.html .
119
120
121
122IEEE/The Open Group 2013 REMQUO(3P)