mul_u64_u64_div_u64(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ mul_u64_u64_div_u64 ✨

okay so bestie, welcome to the Kernel API Manual, section 9 πŸŽ€ β€” this one's a little math baddie and she's honestly kind of iconic.

πŸ’– NAME πŸ’–

mul_u64_u64_div_u64 β€” unsigned 64bit multiply and divide πŸ”₯ (yes, she does both, main character energy fr fr)

πŸ¦‹ SYNOPSIS πŸ¦‹

mul_u64_u64_div_u64 (a , b , d );

🌸 ARGUMENTS 🌸

  • a β€” the first unsigned 64bit multiplicand πŸ’…
  • b β€” the second unsigned 64bit multiplicand πŸ’…
  • d β€” the unsigned 64bit divisor πŸ‘‘

🌈 DESCRIPTION 🌈

So here's the vibe: you multiply two 64bit values together, which gives you a whole 128bit product (glow up ✨), and then you divide that by a third value. Big numbers, no cap.

Now the tea β˜• β€” the Generic code divides by 0 if d is zero, and returns ~0 on overflow. Bestie. Not the zero. 😭 And architecture specific code may trap on zero or overflow β€” so like, be careful, that's not a drill πŸ’€.

⭐ RETURN ⭐

a * b / d

🫢 SEE ALSO 🫢

Kernel file ./include/linux/math64.h β€” go read her sisters, they're all slaying in the same family tree πŸŒ³πŸ’œ:


that's the whole page bestie, you ate that πŸ“πŸ’– mwah!

sign-off szn: brought to you straight out of ./include/linux, dated October 2026, and yes the page is literally called mul_u64_u64_div_u64(9) β€” she's that girl πŸ‘‘πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from