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 265 of file lib8tion.h.

266{
267 return static_cast<sfract15>(f * 32768.0f);
268}
i16 sfract15
ANSI: signed _Fract.
Definition int.h:68

References LIB8STATIC.