Skip to content
Snippets Groups Projects
Commit a78b4209 authored by James Willis's avatar James Willis
Browse files

Make sure the sum is greater than zero before performing division.

parent 52029aba
Branches
Tags
1 merge request!287Particle caching
......@@ -578,7 +578,9 @@ int compare_values(double a, double b, double threshold, double *absDiff,
*absDiff = fabs(a - b);
*absSum = fabs(a + b);
*relDiff = *absDiff / *absSum;
if( *absSum > 0.f) {
*relDiff = *absDiff / *absSum;
}
if (*relDiff > threshold) {
result = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment