FastLED 3.9.15
Loading...
Searching...
No Matches

◆ floatToSfract15()

LIB8STATIC sfract15 floatToSfract15 ( float f)

Conversion from IEEE754 float in the range (-1,1) to 16-bit fixed point (sfract15).

Note
The extremes of one and negative one are NOT representable! The representable range is 0.99996948242 to -0.99996948242, in steps of 0.00003051757.

Definition at line 335 of file lib8tion.h.

336{
337 return static_cast<sfract15>(f * 32768.0f);
338}
i16 sfract15
ANSI: signed _Fract.
Definition s16x16x4.h:180

References LIB8STATIC.