div64_s64_rem(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ div64_s64_rem(9) β€” the kernel API manual, bestie edition

okay so welcome to div64_s64_rem(9), a genuinely iconic little function from the Kernel API Manual. it does signed 64-bit division with a 64-bit divisor AND hands you back the remainder, which is honestly the most thoughtful thing anyone's done for me all week πŸŽ€


✨ NAME ✨

div64_s64_rem β€” signed 64bit divide with 64bit divisor and remainder πŸ’…

like, it divides. it's signed. it's 64-bit. it gives you the leftover. what more do you want from her, she's doing everything 🌸


✨ SYNOPSIS ✨

s64 div64_s64_rem (s64 dividend , s64 divisor , s64 *remainder );

that's the whole vibe. three args, one s64 coming back at you ✨


✨ ARGUMENTS ✨

  • dividend β€” the signed 64bit dividend, aka the number getting chopped up πŸ“ she's the main character of this operation honestly
  • divisor β€” the signed 64bit divisor, aka the number doing the chopping πŸ”₯
  • remainder β€” a pointer to a signed 64bit remainder 🫢 yes it's a pointer, yes she writes through it, that's her whole thing

✨ RETURN ✨

so here's the order of operations bestie, pay attention πŸ‘‘

it sets *remainder first, THEN it returns dividend / divisor.

that's the actual documented sequence, don't come for me β€” set the remainder, then hand back the quotient. both, always. no cap πŸ’–

✨ SEE ALSO ✨

if you liked this one, the whole family is right there in the kernel file ./include/linux/math64.h and honestly they all ate:

like okayyy roundup queen, we see you 🌈 and yeah β€” go read them too, they're all in ./include/linux/math64.h, iykyk πŸ’€


and that's the page!! source is ./include/linux, dated October 2026, filed under div64_s64_rem(9) β€” mwah, love u, go divide something signed πŸ’œβœ¨πŸ§š

πŸ“¦ where this page comes from