Expose fast_log2().

This commit is contained in:
Jared Boone 2016-02-13 11:18:15 -08:00
parent 7d60b940d6
commit d2531016e5
2 changed files with 3 additions and 1 deletions

View File

@ -59,7 +59,7 @@ uint32_t gcd(const uint32_t u, const uint32_t v) {
}
#endif
static float fast_log2(const float val) {
float fast_log2(const float val) {
// Thank you Stack Overflow!
// http://stackoverflow.com/questions/9411823/fast-log2float-x-implementation-c
union {

View File

@ -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);
}
float fast_log2(const float val);
float complex16_mag_squared_to_dbv_norm(const float c16_mag_squared);
inline float magnitude_squared(const std::complex<float> c) {