float_to_long(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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