mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 15:29:28 -05:00
Expose fast_log2().
This commit is contained in:
parent
7d60b940d6
commit
d2531016e5
@ -59,7 +59,7 @@ uint32_t gcd(const uint32_t u, const uint32_t v) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static float fast_log2(const float val) {
|
float fast_log2(const float val) {
|
||||||
// Thank you Stack Overflow!
|
// Thank you Stack Overflow!
|
||||||
// http://stackoverflow.com/questions/9411823/fast-log2float-x-implementation-c
|
// http://stackoverflow.com/questions/9411823/fast-log2float-x-implementation-c
|
||||||
union {
|
union {
|
||||||
|
@ -69,6 +69,8 @@ constexpr size_t log_2(const size_t n, const size_t p = 0) {
|
|||||||
return (n <= 1) ? p : log_2(n / 2, p + 1);
|
return (n <= 1) ? p : log_2(n / 2, p + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float fast_log2(const float val);
|
||||||
|
|
||||||
float complex16_mag_squared_to_dbv_norm(const float c16_mag_squared);
|
float complex16_mag_squared_to_dbv_norm(const float c16_mag_squared);
|
||||||
|
|
||||||
inline float magnitude_squared(const std::complex<float> c) {
|
inline float magnitude_squared(const std::complex<float> c) {
|
||||||
|
Loading…
Reference in New Issue
Block a user