intlog10(9)
π NAME π
okay so this is intlog10(9) β it computes log10 of a value, and the result is shifted left by 24 bits. bestie, it's giving math but make it kernel β¨
β¨ SYNOPSIS β¨
unsigned int intlog10 (u32 value );
π«Ά ARGUMENTS π«Ά
valueβ the value you're putting in, and it must be!= 0. no cap, zero is not invited to this party π
π DESCRIPTION π
so if you wanna use rational values, you can use this method:
intlog10(value) = intlog10(value * 10^x) - x * 2^24
here's a usecase example, bestie:
intlog10(1000) will give 3 << 24 = 3 * 2^24
but heads up π«Ά due to the implementation, intlog10(1000) might be not exactly 3 * 2^24. it's close, but not necessarily exact β lowkey important.
also, look at intlog2 for similar examples π
π RETURN π
log10(value) * 2^24
π SEE ALSO π
- Kernel file
./include/linux/int_log.h intlog2(9)
made with π from the ./include/linux corner, dated October 2026 πβ¨
π¦ 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