FastLED
3.9.15
Loading...
Searching...
No Matches
◆
half_duplex_blend_sqrt_q15()
fl::u8
anonymous_namespace{wave_simulation.cpp}::half_duplex_blend_sqrt_q15
(
fl::u16
x
)
Definition at line
12
of file
wave_simulation.cpp
.
12
{
13
x
=
MIN
(
x
, 32767);
// Q15
14
const
int
Q = 15;
15
fl::u32 X = (fl::u32)
x
<< Q;
// promote to Q30
16
fl::u32
y
= (1u << Q);
// start at β1.0β in Q15
17
18
// 3β4 iterations is plenty for 15βbit precision:
19
for
(
int
i = 0; i < 4; i++) {
20
y
= (
y
+ (X /
y
)) >> 1;
21
}
22
return
static_cast<
fl::i16
>
(
y
) >> 8;
23
}
y
int y
Definition
simple.h:93
x
int x
Definition
simple.h:92
MIN
#define MIN(a, b)
Definition
math_macros.h:41
References
MIN
,
x
, and
y
.
anonymous_namespace{wave_simulation.cpp}
Generated on Fri Aug 22 2025 20:59:36 for FastLED by
1.13.2