From f6f93b5b126d320a223977a07e3e0510ba684ceb Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 16 Jul 2020 11:05:13 +0200 Subject: BLI: add safe_divide, safe_modf and safe_logf Those are defined exactly as their corresponding functions in Cycles. --- source/blender/blenlib/BLI_math_base.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenlib/BLI_math_base.h') diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 49aa9f3b465..93cd902c27f 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -218,6 +218,10 @@ MINLINE unsigned short round_db_to_ushort_clamp(double a); MINLINE int round_db_to_int_clamp(double a); MINLINE unsigned int round_db_to_uint_clamp(double a); +MINLINE float safe_divide(float a, float b); +MINLINE float safe_modf(float a, float b); +MINLINE float safe_logf(float a, float base); + int pow_i(int base, int exp); double double_round(double x, int ndigits); -- cgit v1.2.3