From 8973941897a7b07969b275c18605b1d8f8d4a8d1 Mon Sep 17 00:00:00 2001 From: buddhi1980 Date: Sat, 21 Jul 2018 16:30:08 +0200 Subject: [PATCH] Next approach to elliminate travisCl errors (more abs() crrected to fabs()) --- mandelbulber2/src/common_math.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mandelbulber2/src/common_math.cpp b/mandelbulber2/src/common_math.cpp index 7269fbfb2..710efc27e 100644 --- a/mandelbulber2/src/common_math.cpp +++ b/mandelbulber2/src/common_math.cpp @@ -202,11 +202,11 @@ double MagicRound(double val, double maxError) for (int i = 0; i < 10; i++) { rounded = round(val * multiplier); - double error = fabs(rounded / multiplier - val) / abs(val); + double error = fabs(rounded / multiplier - val) / fabs(val); if (error < maxError) break; double rounded5 = rounded + 0.5; - error = fabs(rounded5 / multiplier - val) / abs(val); + error = fabs(rounded5 / multiplier - val) / fabs(val); if (error < maxError) { rounded = rounded5; @@ -214,7 +214,7 @@ double MagicRound(double val, double maxError) } rounded5 = rounded - 0.5; - error = fabs(rounded5 / multiplier - val) / abs(val); + error = fabs(rounded5 / multiplier - val) / fabs(val); if (error < maxError) { rounded = rounded5; @@ -222,7 +222,7 @@ double MagicRound(double val, double maxError) } rounded5 = rounded + 0.25; - error = fabs(rounded5 / multiplier - val) / abs(val); + error = fabs(rounded5 / multiplier - val) / fabs(val); if (error < maxError) { rounded = rounded5; @@ -230,7 +230,7 @@ double MagicRound(double val, double maxError) } rounded5 = rounded - 0.25; - error = fabs(rounded5 / multiplier - val) / abs(val); + error = fabs(rounded5 / multiplier - val) / fabs(val); if (error < maxError) { rounded = rounded5;