Make lm35 convert function use i32 for uom base type for voltage and temperature #10
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Integer operations may be faster on some devices. All possible values and all arithmetic needed for the conversion can fit in and be done with an
i32
. The cast to af32
should always be a single fast instruction. Should we:i32
.i32
version of the convert function in addition to the f32 version.It's problem is to scale we need to convert the voltage to a certain unit. To not use a decimal and get full accuracy that unit would need to be millivolts but if we use millivolts instead of volts we would need to divide instead of multiply and integer division would presumably be much slower than even float multiplication so we will leave it as f32.