diff options
author | Himanshi Kalra <calra> | 2021-08-23 22:19:36 +0300 |
---|---|---|
committer | Himanshi Kalra <himanshikalra98@gmail.com> | 2021-08-23 22:20:03 +0300 |
commit | 875c2ea5b5ee8425c3bc969dbaba3fab3ecbaab4 (patch) | |
tree | 94d45e8fb3d508e77aa177d253c39186b9863e30 /source/blender/blenlib/BLI_math_base.h | |
parent | be1891e895c012b36ca574a90b5d90fc1433152e (diff) |
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
Diffstat (limited to 'source/blender/blenlib/BLI_math_base.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_base.h | 3 |
1 files changed, 3 insertions, 0 deletions
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); |