diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-05-20 23:03:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-20 23:03:38 +0200 |
commit | 98071ec136bad8ede5f8c0505e6cff6f33f787ef (patch) | |
tree | 2f664463c7e8deabd7581bf9e99445654e51d748 | |
parent | 78d85de13be383b24252a38e42bec5be81721ea7 (diff) | |
parent | b01aa69c80aa8c953d9ec885238c7cfd8063019b (diff) |
Merge pull request #48887 from aaronfranke/round
Use global scope round method for rounding
-rw-r--r-- | core/math/math_funcs.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index 40234f6ae5..0a3b6ae9da 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -275,8 +275,8 @@ public: static _ALWAYS_INLINE_ double db2linear(double p_db) { return Math::exp(p_db * 0.11512925464970228420089957273422); } static _ALWAYS_INLINE_ float db2linear(float p_db) { return Math::exp(p_db * 0.11512925464970228420089957273422); } - static _ALWAYS_INLINE_ double round(double p_val) { return (p_val >= 0) ? Math::floor(p_val + 0.5) : -Math::floor(-p_val + 0.5); } - static _ALWAYS_INLINE_ float round(float p_val) { return (p_val >= 0) ? Math::floor(p_val + 0.5) : -Math::floor(-p_val + 0.5); } + static _ALWAYS_INLINE_ double round(double p_val) { return ::round(p_val); } + static _ALWAYS_INLINE_ float round(float p_val) { return ::roundf(p_val); } static _ALWAYS_INLINE_ int64_t wrapi(int64_t value, int64_t min, int64_t max) { int64_t range = max - min; |