1REMQUO(3P)                 POSIX Programmer's Manual                REMQUO(3P)
2
3
4

PROLOG

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

NAME

12       remquo, remquof, remquol - remainder functions
13

SYNOPSIS

15       #include <math.h>
16
17       double remquo(double x, double y, int *quo);
18       float remquof(float x, float y, int *quo);
19       long double remquol(long double x, long double y, int *quo);
20
21

DESCRIPTION

23       The remquo(), remquof(), and remquol() functions shall compute the same
24       remainder as the remainder(), remainderf(), and remainderl() functions,
25       respectively. In the object pointed to by quo, they store a value whose
26       sign  is  the sign of x/ y and whose magnitude is congruent modulo 2**n
27       to the magnitude of the integral quotient of x/ y, where n is an imple‐
28       mentation-defined integer greater than or equal to 3.
29
30       An  application  wishing to check for error situations should set errno
31       to zero and  call  feclearexcept(FE_ALL_EXCEPT)  before  calling  these
32       functions.   On return, if errno is non-zero or fetestexcept(FE_INVALID
33       | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error  has
34       occurred.
35

RETURN VALUE

37       These functions shall return x REM y.
38
39       If x or y is NaN, a NaN shall be returned.
40
41       If  x  is ±Inf or y is zero and the other argument is non-NaN, a domain
42       error shall occur, and either a NaN (if supported), or  an  implementa‐
43       tion-defined value shall be returned.
44

ERRORS

46       These functions shall fail if:
47
48       Domain Error
49              The  x  argument  is ±Inf, or the y argument is ±0 and the other
50              argument is non-NaN.
51
52       If the integer expression (math_errhandling & MATH_ERRNO) is  non-zero,
53       then   errno  shall  be  set  to  [EDOM].  If  the  integer  expression
54       (math_errhandling &  MATH_ERREXCEPT)  is  non-zero,  then  the  invalid
55       floating-point exception shall be raised.
56
57
58       The following sections are informative.
59

EXAMPLES

61       None.
62

APPLICATION USAGE

64       On   error,   the   expressions  (math_errhandling  &  MATH_ERRNO)  and
65       (math_errhandling & MATH_ERREXCEPT) are independent of each other,  but
66       at least one of them must be non-zero.
67

RATIONALE

69       These functions are intended for implementing argument reductions which
70       can exploit a few low-order bits of the quotient. Note that x may be so
71       large  in  magnitude  relative to y that an exact representation of the
72       quotient is not practical.
73

FUTURE DIRECTIONS

75       None.
76

SEE ALSO

78       feclearexcept(), fetestexcept(), remainder(), the Base Definitions vol‐
79       ume  of  IEEE Std 1003.1-2001,  Section 4.18, Treatment of Error Condi‐
80       tions for Mathematical Functions, <math.h>
81
83       Portions of this text are reprinted and reproduced in  electronic  form
84       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
85       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
86       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
87       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
88       event of any discrepancy between this version and the original IEEE and
89       The Open Group Standard, the original IEEE and The Open Group  Standard
90       is  the  referee document. The original Standard can be obtained online
91       at http://www.opengroup.org/unix/online.html .
92
93
94
95IEEE/The Open Group                  2003                           REMQUO(3P)
Impressum