FastLED 3.9.15
|
LIB8STATIC_ALWAYS_INLINE uint8_t mod8 | ( | uint8_t | a, |
uint8_t | m ) |
Calculate the remainder of one unsigned 8-bit value divided by anoter, aka A % M.
Implemented by repeated subtraction, which is very compact, and very fast if A is "probably" less than M. If A is a large multiple of M, the loop has to execute multiple times. However, even in that case, the loop is only two instructions long on AVR, i.e., quick.
a | dividend byte |
m | divisor byte |
Definition at line 361 of file math8.h.
References LIB8STATIC_ALWAYS_INLINE.