REMQUO(3P)
β¨ REMQUO(3P) β the POSIX girlie manual β¨
okay bestie, this one is remquo from the POSIX Programmer's Manual (that's the 3P in the name, iykyk) π
πΈ PROLOG πΈ
so like, real talk first: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β like, actually consult the corresponding Linux manual page for the deets on Linux behavior β or honestly the interface might not even be implemented on Linux at all π. no cap.
π NAME π
remquo, remquof, remquol β the remainder functions. periodt.
π SYNOPSIS π
#include <math.h>
double remquo(double x, double y, int *quo);
float remquof(float x, float y, int *quo);
long double remquol(long double x, long double y, int *quo);
three flavors, one vibe. π
π¦ DESCRIPTION π¦
so the functionality described on this reference page is aligned with the ISO C standard. if there's any conflict between the requirements described here and the ISO C standard, that's unintentional β this volume of POSIX.1β2017 defers to the ISO C standard, okay? it's not that deep, the standard wins. π
now the actual tea: remquo(), remquof(), and remquol() shall compute the same remainder as the remainder(), remainderf(), and remainderl() functions, respectively. same energy, different name bestie.
and then β the main character move β in the object pointed to by quo, they store a value whose sign is the sign of x/y and whose magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/y, where n is an implementation-defined integer greater than or equal to 3. iconic behavior honestly.
β οΈ but bestie, ifyis zero, the value stored in the object pointed to byquois unspecified. like, we don't know her. don't count on it. π
and if you're the type of application that wants to check for error situations (responsible queen behavior π«Ά), you should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions. then on return, if errno is non-zero, or if fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred. that's your vibe check. β
π RETURN VALUE π
these functions shall return x REM y. simple as that, bestie.
on systems that do not support the IEC 60559 Floating-Point option, if y is zero, it is implementation-defined whether a domain error occurs or zero is returned. so like, depends on the system, lowkey unpredictable. π
if x or y is NaN, a NaN shall be returned. NaN in, NaN out, that's the law. β¨
if x is Β±Inf or y is zero and the other argument is non-NaN, a domain error shall occur, and a NaN shall be returned. so like, that's a real error moment, not a fake one. π
π₯ ERRORS π₯
these functions shall fail if:
- Domain Error β the
xargument isΒ±Inf, or theyargument isΒ±0and the other argument is non-NaN.- if the integer expression
(math_errhandling & MATH_ERRNO)is non-zero, thenerrnoshall be set to[EDOM]. - if the integer expression
(math_errhandling & MATH_ERREXCEPT)is non-zero, then the invalid floating-point exception shall be raised.
- if the integer expression
these functions may fail if:
- Domain Error β the
yargument is zero.- if the integer expression
(math_errhandling & MATH_ERRNO)is non-zero, thenerrnoshall be set to[EDOM]. - if the integer expression
(math_errhandling & MATH_ERREXCEPT)is non-zero, then the invalid floating-point exception shall be raised.
- if the integer expression
and then β plot twist β the following sections are informative. so like, the rest is bonus content, not requirements. π
π EXAMPLES π
None.
literally nothing. not one example. we move. π
π APPLICATION USAGE π
on error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling & MATH_ERREXCEPT) are independent of each other, but at least one of them must be non-zero. they're not besties, they don't depend on each other, but you need at least one of them showing up to the function. β¨
π RATIONALE π
so these functions are intended for implementing argument reductions which can exploit a few low-order bits of the quotient. that's the whole point of the quo situation β you don't need the whole quotient, just the vibe of a few low bits. π
and note: x may be so large in magnitude relative to y that an exact representation of the quotient is not practical. like, the quotient is simply too big to hold, bestie. that's why this function exists. π
π§ FUTURE DIRECTIONS π§
None.
the future is bright and empty. slay. π
π SEE ALSO π
feclearexcept()fetestexcept()remainder()
and also, from the Base Definitions volume of POSIX.1β2017:
- Section 4.20, Treatment of Error Conditions for Mathematical Functions
<math.h>
π COPYRIGHT π
portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. π«Ά
in the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. so like, if there's drama, the original wins, no debate. π
the original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . we appreciate you fr fr π
okay that's the whole page bestie, hope you ate it up π this was brought to you by IEEE/The Open Group, 2017, and it's giving REMQUO(3P) energy all the way to the end. mwah! πβ¨π
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms