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.0 and might store 2.

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.
bestie. listen. these functions do not set errno. at all. so if you're out here checking errno, 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms