From f0a3ea54f86256c229735c5766e9edfe8ba2acd4 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Wed, 18 Jun 2014 13:13:22 +0900 Subject: Fix for weak floating-point number comparison. Was causing assertion failures in MinGW-w64. --- source/blender/editors/interface/interface_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/interface/interface_utils.c') 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. -- cgit v1.2.3