From 875c2ea5b5ee8425c3bc969dbaba3fab3ecbaab4 Mon Sep 17 00:00:00 2001 From: Himanshi Kalra Date: Tue, 24 Aug 2021 00:49:36 +0530 Subject: Using relative threshold for floats in mesh comparison Changes the threshold comparison from absolute to relative. Removes threshold for MLoopCol comparison. Adds a compare relative threshold function. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12273 --- source/blender/blenlib/BLI_math_base.h | 3 +++ 1 file changed, 3 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 dbdd28766a5..9b54f780296 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -172,6 +172,9 @@ MINLINE size_t clamp_z(size_t value, size_t min, size_t max); MINLINE int compare_ff(float a, float b, const float max_diff); MINLINE int compare_ff_relative(float a, float b, const float max_diff, const int max_ulps); +MINLINE bool compare_threshold_relative(const float value1, + const float value2, + const float thresh); MINLINE float signf(float f); MINLINE int signum_i_ex(float a, float eps); -- cgit v1.2.3