diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-16 12:28:31 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-16 12:28:31 +0300 |
commit | d89722868299afae8979e4b8dce9f40cb8576579 (patch) | |
tree | 398ec11f7ec08c0b5881d2345734c5765949a033 /source/blender/blenlib/intern/math_base_inline.c | |
parent | f6f93b5b126d320a223977a07e3e0510ba684ceb (diff) |
BLI: move safe math functions to separate header
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index bd4eb12a72c..1b388dcf11f 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -70,13 +70,6 @@ MINLINE float pow7f(float x) { return pow2f(pow3f(x)) * x; } -MINLINE float safe_powf(float base, float exponent) -{ - if (UNLIKELY(base < 0.0f && exponent != (int)exponent)) { - return 0.0f; - } - return powf(base, exponent); -} MINLINE float sqrt3f(float f) { @@ -348,24 +341,6 @@ MINLINE signed char round_db_to_char_clamp(double a){ #undef _round_clamp_fl_impl #undef _round_clamp_db_impl -MINLINE float safe_divide(float a, float b) -{ - return (b != 0.0f) ? a / b : 0.0f; -} - -MINLINE float safe_modf(float a, float b) -{ - return (b != 0.0f) ? fmodf(a, b) : 0.0f; -} - -MINLINE float safe_logf(float a, float base) -{ - if (UNLIKELY(a <= 0.0f || base <= 0.0f)) { - return 0.0f; - } - return safe_divide(logf(a), logf(base)); -} - /* integer division that rounds 0.5 up, particularly useful for color blending * with integers, to avoid gradual darkening when rounding down */ MINLINE int divide_round_i(int a, int b) |