aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2022-02-20 19:21:34 -0800
committer3gg <3gg@shellblade.net>2022-02-20 19:21:34 -0800
commit658237ae8a8123e1fb66c3ee39d08a51fe824156 (patch)
tree2c9f2ef8747ed4b40deb95cea275b89b384e2c02
parente905674daae8622d0f86a592b8b3008673a524f6 (diff)
Add rlog2.
-rw-r--r--include/math/defs.h2
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
32static inline double min(R a, R b) { return fmin(a, b); } 32static inline double min(R a, R b) { return fmin(a, b); }
33static inline double max(R a, R b) { return fmax(a, b); } 33static inline double max(R a, R b) { return fmax(a, b); }
34static inline double rlog2(R a) { return log2(a); }
34#else // floats 35#else // floats
35static inline float min(R a, R b) { return fminf(a, b); } 36static inline float min(R a, R b) { return fminf(a, b); }
36static inline float max(R a, R b) { return fmaxf(a, b); } 37static inline float max(R a, R b) { return fmaxf(a, b); }
38static inline float rlog2(R a) { return log2f(a); }
37#endif 39#endif
38 40
39static inline R rabs(R x) { return x >= 0.0 ? x : -x; } 41static inline R rabs(R x) { return x >= 0.0 ? x : -x; }