mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00
Fix divide-by-zero in Entropy analyzer
This commit is contained in:
parent
091424b2ad
commit
264e6858f2
1 changed files with 1 additions and 1 deletions
|
@ -136,7 +136,7 @@ void RandTest::end(double* r_ent, double* r_chisq,
|
|||
|
||||
/* Calculate Monte Carlo value for PI from percentage of hits
|
||||
within the circle */
|
||||
montepi = 4.0 * (((double) inmont) / mcount);
|
||||
montepi = mcount == 0 ? 0 : 4.0 * (((double) inmont) / mcount);
|
||||
|
||||
/* Return results through arguments */
|
||||
*r_ent = ent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue