FastLED 3.10.8
Loading...
Searching...
No Matches

◆ halfOf()

template<typename T>
T fl::gfx::halfOf ( T val)
inline

Divide Coord by 2 using shift (avoids expensive division on embedded).

s16x16: raw right-shift (1 instruction). float: multiply by 0.5.

Definition at line 79 of file primitives.h.

79{ return val / fromInt<T>(2); }
T fromInt(int n) FL_NO_EXCEPT
Convert an integer to Coord without float intermediate.
Definition primitives.h:59

References fl::FL_NO_EXCEPT, and fromInt().

+ Here is the call graph for this function: