div_u64_rem(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… div_u64_rem(9) β€” the kernel API manual, bestie edition πŸŽ€

okay so this is div_u64_rem from the Kernel API Manual, and honestly she's that girl: unsigned 64bit divide with a 32bit divisor, and she hands you the remainder. no cap. math girls stay winning ✨


✨ NAME ✨

div_u64_rem β€” unsigned 64bit divide with 32bit divisor with remainder πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

u64 div_u64_rem (u64 dividend , u32 divisor , u32 *remainder );

like literally that's the whole signature. three args, zero drama, one quotient, one remainder. we love a clean API. 🫢

🌸 ARGUMENTS 🌸

  • dividend β€” your unsigned 64bit dividend, aka the big number that's about to get split up πŸ’€
  • divisor β€” your unsigned 32bit divisor, aka the smaller number doing the splitting. she's 32bit and she knows it πŸ‘‘
  • remainder β€” pointer to an unsigned 32bit remainder. yes bestie, it's a pointer, she writes back into your variable πŸ™ˆ

⭐ RETURN ⭐

okay so the order of operations here actually matters: it sets *remainder, then returns dividend / divisor. so you get the quotient back as the return value and the leftover goes home in your pointer. iconic, honestly. πŸŽ€

🌈 DESCRIPTION 🌈

This is commonly provided by 32bit archs to provide an optimized 64bit divide. so on those arches she's the main character β€” the whole reason the helper exists is so a 32bit machine doesn't have to do 64bit division the painful way. ate and left no crumbs πŸ”₯

ngl, the "commonly provided by 32bit archs" part is the whole vibe check here β€” it's an optimization helper, not just a wrapper for the fun of it.

🧚 SEE ALSO 🧚

she does not roll alone, the whole math64 girlie squad is in ./include/linux/math64.h:

all of them live in Kernel file ./include/linux/math64.h, so go say hi πŸ’œ


sign-off time 🫢 this lil page ships from ./include/linux, dated October 2026, and it's div_u64_rem(9) through and through. stay dividing, bestie β€” quotient in the return, remainder in the pointer, no cap πŸ’…βœ¨

πŸ“¦ where this page comes from