FastLED 3.10.10
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 84 of file primitives.h.

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

References fl::FL_NO_EXCEPT, and fromInt().

+ Here is the call graph for this function: