div_s64(9)
β¨ div_s64 β signed 64bit divide with 32bit divisor π
okay so bestie, welcome to the div_s64(9) page, straight out of the Kernel API Manual π. this one is short and sweet and honestly iconic for it β it's a little math baddie that does one job and does it flawlessly.
πΈ SYNOPSIS πΈ
s64 div_s64 (s64 dividend , s32 divisor );
like, look at her. two args, one return, no drama. main character energy fr fr β¨
π¦ ARGUMENTS π¦
dividendβ the signed 64bit dividend π, aka the number getting chopped up. it's ans64, so she's big and she can go negative, we love a range queen.divisorβ the signed 32bit divisor π, aka the number doing the chopping. tiny but mighty, ans32, signed and everything.
π RETURN π
the function hands you back dividend / divisor β that's it, that's the whole vibe. the quotient, served fresh, no cap π
ngl bestie, this page does not spell out what happens ifdivisoris0. the docs stay silent, so don't come for me β just know the manpage makes zero promises there π
π SEE ALSO π
okay the friend group is huge and they're all in the kernel file ./include/linux/math64.h β go say hi to the whole crew:
div_u64_rem(9)div_s64_rem(9)div64_u64_rem(9)div64_s64_rem(9)div64_u64(9)div64_s64(9)div_u64(9)mul_u64_add_u64_div_u64(9)mul_u64_u64_div_u64(9)mul_u64_u64_div_u64_roundup(9)DIV64_U64_ROUND_UP(9)DIV_U64_ROUND_UP(9)DIV64_U64_ROUND_CLOSEST(9)DIV_U64_ROUND_CLOSEST(9)DIV_S64_ROUND_CLOSEST(9)roundup_u64(9)
literally the whole math64 extended universe, iykyk π§π
that's the page!! mwah, go divide something signed π«Ά
this one came to you from the source ./include/linux, dated October 2026 β periodt, end of page, stan the kernel docs βπ₯
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms