MCPcopy Create free account
hub / github.com/FastLED/FastLED / _highest_bit_step

Function _highest_bit_step

src/fl/math/fixed_point/s16x16.h:327–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325 }
326
327 static constexpr int _highest_bit_step(u32 v, int r) FL_NOEXCEPT {
328 return (v & 0xFFFF0000u) ? _highest_bit_step(v >> 16, r + 16)
329 : (v & 0x0000FF00u) ? _highest_bit_step(v >> 8, r + 8)
330 : (v & 0x000000F0u) ? _highest_bit_step(v >> 4, r + 4)
331 : (v & 0x0000000Cu) ? _highest_bit_step(v >> 2, r + 2)
332 : (v & 0x00000002u) ? r + 1
333 : r;
334 }
335
336 // Fixed-point log base 2 for positive values.
337 // Uses 4-term minimax polynomial for log2(1+t), t in [0,1).

Callers 1

lerpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected