float_to_long(9)
π float_to_long(9) π
hey bestie π«Ά this is the float_to_long(9) page from the Kernel API Manual, and it's short, sweet, and here to turn your hardware float reading into an integer. iykyk β¨
πΈ NAME πΈ
float_to_long β converts an ieee754 reading from hardware to an integer. literally that's the whole job, and it ate π
β¨ SYNOPSIS β¨
long float_to_long (u32 data , u32 precision );
π ARGUMENTS π
dataβ the value read from the hardware π«Άprecisionβ the units it multiplies up to, eg.1000= milli,1000000= micro β¨
π RETURN π
the converted integer reading. slay, no cap π
π¦ DESCRIPTION π¦
okay so depending on the measurement type, the hardware returns an ieee754 floating point value in either volts, amps, or celsius. this function converts that into an integer in a smaller unit such as micro-amps or milli-celsius. and before you stress: the hardware does not return NaN, so you do not need to consider that at all π
ββοΈπ
π₯ SEE ALSO π₯
- Kernel file
./drivers/hwmon/lochnagar-hwmon.cβ go peek if you want the whole vibe πβ¨
this page comes from ./drivers/hwmon, is dated October 2026, and is all about float_to_long(9) β mwah π
π¦ 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