max_pow_of_two_factor(9)
π max_pow_of_two_factor(9) β the kernel API glow-up π
okay bestie, welcome to the max_pow_of_two_factor(9) page from the Kernel API Manual β¨ this one is short but she's iconic, ngl.
πΈ NAME πΈ
max_pow_of_two_factor β returns the highest power-of-2 factor, periodt π
β SYNOPSIS β
unsigned int max_pow_of_two_factor (unsigned int n );
like, you hand her an unsigned int and she hands you back an unsigned int. that's the whole vibe π¦
π ARGUMENTS π
nβ parameter π that's literally the whole description the original gives, so i'm not gonna invent lore for it. she's justn, the argument, the main character of this function π
π DESCRIPTION π
so what she does is: find the highest power-of-2 which is evenly divisible into n π₯ like genuinely, evenly divisible, no remainder crumbs left over.
and the special-case tea β: 0 is returned for n == 0 or 1. both of those get you a 0, no cap π
careful bestie β that 0 back is a real return value, not an error code, so don't go reading drama into it that isn't there π«Ά
π SEE ALSO π
the whole log2 girlie friend group lives in the Kernel file ./include/linux/log2.h, and you should absolutely go say hi to:
is_power_of_2(9)__roundup_pow_of_two(9)__rounddown_pow_of_two(9)const_ilog2(9)ilog2(9)roundup_pow_of_two(9)rounddown_pow_of_two(9)order_base_2(9)bits_per(9)
iykyk, that file is the moment π β¨
mwah, that's the whole page! she's short but she ate π
this little love letter comes courtesy of ./include/linux π§ and the version/date stamp on her birth certificate says October 2026 β iconic era, honestly πΈπ bye bestie! π
π¦ 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