intlog2(9)
π intlog2(9) π β Kernel API Manual
okay so bestie, welcome to the intlog2 page from the Kernel API Manual. it's a little log2 situation, and the result is shifted left by 24 bits, iykyk. no cap, the vibes are mathematical but we're gonna get through it together. π«Ά
β¨ NAME β¨
intlog2 β computes log2 of a value; the result is shifted left by 24 bits. slay. π
πΈ SYNOPSIS πΈ
unsigned int intlog2 (u32 value );
π ARGUMENTS π
valueβ the value, and bestie it must be!= 0. like, zero is literally not invited π.
π¦ DESCRIPTION π¦
okay so to use rational values you can use the following method, and yes it's giving formula:
intlog2(value) = intlog2(value * 2^x) - x * 2^24
Some usecase examples β these are exact, don't come for me:
intlog2(8) will give 3 << 24 = 3 * 2^24
intlog2(9) will give 3 << 24 + ... = 3.16... * 2^24
intlog2(1.5) = intlog2(3) - 2^24 = 0.584... * 2^24
β RETURN β
you get log2(value) * 2^24. that's it, that's the return, periodt. π₯
π SEE ALSO π
- Kernel file
./include/linux/int_log.hβ yes, that exact path, iconic behavior. intlog10(9)β the related logarithm page, go peep it π.
okay bye bestie π this page is from ./include/linux, dated October 2026, and it's the intlog2(9) page β periodt. π«Ά
π¦ 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