forked from enlightenment/efl
benchmarks: eina: make sure we do not divide by zero
Make sure we do not divide by i if it is zero here. CID: 1400768 Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11956
This commit is contained in:
parent
794c52d200
commit
9c773ed5cf
|
@ -429,9 +429,12 @@ ecore_hash_dump_stats(Ecore_Hash *hash)
|
|||
sum_n += (double)n;
|
||||
}
|
||||
}
|
||||
if (i)
|
||||
{
|
||||
variance = (sum_n_2 - ((sum_n * sum_n) / (double)i)) / (double)i;
|
||||
printf("Average length: %f\n\tvariance^2: %f", (sum_n / (double)i),
|
||||
variance);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue