From 658237ae8a8123e1fb66c3ee39d08a51fe824156 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sun, 20 Feb 2022 19:21:34 -0800 Subject: Add rlog2. --- include/math/defs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') 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; #ifdef MATH_USE_DOUBLE static inline double min(R a, R b) { return fmin(a, b); } static inline double max(R a, R b) { return fmax(a, b); } +static inline double rlog2(R a) { return log2(a); } #else // floats static inline float min(R a, R b) { return fminf(a, b); } static inline float max(R a, R b) { return fmaxf(a, b); } +static inline float rlog2(R a) { return log2f(a); } #endif static inline R rabs(R x) { return x >= 0.0 ? x : -x; } -- cgit v1.2.3