diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-06-18 08:13:22 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-06-18 09:18:41 +0400 |
commit | f0a3ea54f86256c229735c5766e9edfe8ba2acd4 (patch) | |
tree | 9e6e9b6e58295e16c65b094dc92426b51c2bf3c7 /source/blender/editors/interface/interface_utils.c | |
parent | a82d3f85c689056681ba608624e8326c09415293 (diff) |
Fix for weak floating-point number comparison.
Was causing assertion failures in MinGW-w64.
Diffstat (limited to 'source/blender/editors/interface/interface_utils.c')
-rw-r--r-- | source/blender/editors/interface/interface_utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 2c958c5028a..744ed7e5b72 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -253,7 +253,7 @@ int uiFloatPrecisionCalc(int prec, double value) static const double max_pow = 10000000.0; /* pow(10, UI_PRECISION_FLOAT_MAX) */ BLI_assert(prec <= UI_PRECISION_FLOAT_MAX); - BLI_assert(pow10_neg[prec] == pow(10, -prec)); + BLI_assert(fabs(pow10_neg[prec] - pow(10, -prec)) < 1e-16); /* check on the number of decimal places need to display the number, this is so 0.00001 is not displayed as 0.00, * _but_, this is only for small values si 10.0001 will not get the same treatment. |