remquo(3)
π remquo(3) β bestie edition π
okay so. you're reading a man page from the Library Functions Manual and honestly? it's giving math girlie. welcome to remquo, remquof and remquol. yes those are three separate functions. yes they're basically the same function wearing different outfits. no cap. π
β¨ NAME β¨
remquo, remquof, remquol β remainder and part of quotient π¦
π LIBRARY π
Math library β link it with libm, i.e. the -lm flag. your compiler needs to know. don't forget it. i'm begging. π
πΈ 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);
π§ Feature Test Macro Requirements for glibc β the lore β¨
(peep feature_test_macros(7) if you wanna go deeper, bestie)
So for remquo(), remquof() and remquol(), you need one of these to be true:
_ISOC99_SOURCE_POSIX_C_SOURCE >= 200112L
that's it. that's the gatekeeping. the bouncer at the club. π«Ά
π DESCRIPTION π
So these functions compute two things at once β the remainder AND part of the quotient when you divide x by y. iconic multitasking honestly.
A few bits of the quotient get stored through the quo pointer. The remainder comes back as the actual function return value. so you get one thing handed to you and one thing yeeted into your pointer. classic. π₯
The value of that remainder? Literally the same as what the remainder(3) function computes. same math, same energy.
The value stored via quo has the sign of x / y, and it agrees with the quotient in at least the low order 3 bits. three bits bestie. that's what you're getting. π
okay example time, pay attention:
remquo(29.0, 3.0)returns-1.0and might store2.
and like. heads up. a genuine warning here. the actual quotient might not fit in an integer. so don't go assuming it will. π
π RETURN VALUE π
On success, these functions return the same value as the analogous functions described in remainder(3). matching energy. consistent. slay.
- If x or y is a NaN, a NaN is returned.
- If x is an infinity, and y is not a NaN, a domain error occurs, and a NaN is returned.
- If y is zero, and x is not a NaN, a domain error occurs, and a NaN is returned.
π ERRORS π
Wanna know how to tell if an error happened? Go read math_error(7). that's the manual for this exact situation. iykyk.
The following errors can occur:
- Domain error: x is an infinity or y is 0, and the other argument is not a NaN.
- An invalid floating-point exception (
FE_INVALID) is raised.
- An invalid floating-point exception (
bestie. listen. these functions do not seterrno. at all. so if you're out here checkingerrno, that's not the move. ok? ok. π
π ATTRIBUTES π
for an explanation of the terms used in this section, peep attributes(7).
- Interface:
remquo(),remquof(),remquol()- Attribute: Thread safety
- Value:
MT-Safeβ
(no table for you, the terminal said no, but you got all the tea anyway π)
π STANDARDS π
C11, POSIX.1-2008.
π HISTORY π
glibc 2.1. πΆC99,POSIX.1-2001.
π SEE ALSO π
fmod(3), logb(3), remainder(3)
and that's the whole page bestie, you ate it up fr fr π
this lil masterpiece is from Linux man-pages 6.20, dated 2026-02-08, and it lives at remquo(3). periodt. πβ¨
π¦ where this page comes from
- 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 6.20
- π the page's license: GPL-1.0-or-later
- Copyright 2002, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms