diff options
author | 3gg <3gg@shellblade.net> | 2022-02-20 19:21:34 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2022-02-20 19:21:34 -0800 |
commit | 658237ae8a8123e1fb66c3ee39d08a51fe824156 (patch) | |
tree | 2c9f2ef8747ed4b40deb95cea275b89b384e2c02 /include | |
parent | e905674daae8622d0f86a592b8b3008673a524f6 (diff) |
Add rlog2.
Diffstat (limited to 'include')
-rw-r--r-- | include/math/defs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/math/defs.h b/include/math/defs.h index acfb037..e3c3b55 100644 --- a/include/math/defs.h +++ b/include/math/defs.h | |||
@@ -31,9 +31,11 @@ typedef float R; | |||
31 | #ifdef MATH_USE_DOUBLE | 31 | #ifdef MATH_USE_DOUBLE |
32 | static inline double min(R a, R b) { return fmin(a, b); } | 32 | static inline double min(R a, R b) { return fmin(a, b); } |
33 | static inline double max(R a, R b) { return fmax(a, b); } | 33 | static inline double max(R a, R b) { return fmax(a, b); } |
34 | static inline double rlog2(R a) { return log2(a); } | ||
34 | #else // floats | 35 | #else // floats |
35 | static inline float min(R a, R b) { return fminf(a, b); } | 36 | static inline float min(R a, R b) { return fminf(a, b); } |
36 | static inline float max(R a, R b) { return fmaxf(a, b); } | 37 | static inline float max(R a, R b) { return fmaxf(a, b); } |
38 | static inline float rlog2(R a) { return log2f(a); } | ||
37 | #endif | 39 | #endif |
38 | 40 | ||
39 | static inline R rabs(R x) { return x >= 0.0 ? x : -x; } | 41 | static inline R rabs(R x) { return x >= 0.0 ? x : -x; } |