Skip to content

Commit

Permalink
Next approach to elliminate travisCl errors (more abs() crrected to f…
Browse files Browse the repository at this point in the history
…abs())
  • Loading branch information
buddhi1980 committed Jul 21, 2018
1 parent d8ec149 commit 8973941
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mandelbulber2/src/common_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,35 +202,35 @@ 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;
break;
}

rounded5 = rounded - 0.5;
error = fabs(rounded5 / multiplier - val) / abs(val);
error = fabs(rounded5 / multiplier - val) / fabs(val);
if (error < maxError)
{
rounded = rounded5;
break;
}

rounded5 = rounded + 0.25;
error = fabs(rounded5 / multiplier - val) / abs(val);
error = fabs(rounded5 / multiplier - val) / fabs(val);
if (error < maxError)
{
rounded = rounded5;
break;
}

rounded5 = rounded - 0.25;
error = fabs(rounded5 / multiplier - val) / abs(val);
error = fabs(rounded5 / multiplier - val) / fabs(val);
if (error < maxError)
{
rounded = rounded5;
Expand Down

0 comments on commit 8973941

Please sign in to comment.