DIV_U64_ROUND_CLOSEST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ DIV_U64_ROUND_CLOSEST πŸ’…

okay bestie, welcome to the Kernel API Manual 🌸 and today's main character is DIV_U64_ROUND_CLOSEST β€” literally the "divide a big unsigned number by a smaller unsigned number and round it nicely" girlie. no cap, she's iconic and she's about to make ur math cute πŸŽ€


πŸ¦‹ NAME

DIV_U64_ROUND_CLOSEST β€” unsigned 64bit divide with 32bit divisor rounded to nearest integer ✨

like... big number, small number, fancy rounding. that's the whole vibe πŸ’–


🫢 SYNOPSIS

DIV_U64_ROUND_CLOSEST (dividend , divisor );

(yeah the spacing is a little weird, she's quirky like that, don't @ her 😭)


πŸ“ ARGUMENTS

  • dividend β€” the unsigned 64bit dividend πŸ’œ lowkey the big one, the star of the show
  • divisor β€” the unsigned 32bit divisor πŸ¦‹ the smol one doing the dividing, we love her

🌈 DESCRIPTION

Divide unsigned 64bit dividend by unsigned 32bit divisor and round to closest integer.

that's it, that's the whole thing. big number Γ· smol number, but instead of just chopping the decimal off, she rounds to whichever integer is closest. it's giving "best of both worlds", it's giving "attention to detail" πŸ‘‘ no truncation erasure here πŸ’…


⭐ RETURN

dividend / divisor rounded to nearest integer πŸŽ€

so like, the answer comes back all clean and integer-y, already rounded for u, no extra work required. slay ✨


πŸ‘‘ SEE ALSO

she lives in the kernel file ./include/linux/math64.h πŸ’– and honestly she runs with a whole squad, so go say hi to:

fr fr go read the whole squad, they're all in the same math64.h friend group 🌸

k that's the whole page bestie, hope the rounding math is giving everything u needed πŸ’…βœ¨

source: ./include/linux Β· version: October 2026 Β· mwah, catch u in the next manpage πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from