mirror of
https://github.com/kdlucas/byte-unixbench.git
synced 2024-12-11 23:30:07 +08:00
Run - Can't take log of 0
do not attempt to take log() of 0 github: fixes #21
This commit is contained in:
parent
e0b8c00209
commit
a04d7c6b63
@ -947,12 +947,12 @@ sub combinePassResults {
|
||||
|
||||
# If $timebase is 0 the figure is a rate; else compute
|
||||
# counts per $timebase. $time is always seconds.
|
||||
if ($timebase > 0) {
|
||||
if ($timebase > 0 && $time > 0) {
|
||||
$sum += $count / ($time / $timebase);
|
||||
$product += log($count) - log($time / $timebase);
|
||||
$product += log($count) - log($time / $timebase) if ($count > 0);
|
||||
} else {
|
||||
$sum += $count;
|
||||
$product += log($count);
|
||||
$product += log($count) if ($count > 0);
|
||||
}
|
||||
$totalTime += $time;
|
||||
}
|
||||
@ -1030,7 +1030,7 @@ sub indexResults {
|
||||
$bresult->{'index'} = $ratio * 10;
|
||||
|
||||
# Sun the scores, and count this test for this category.
|
||||
$sum->{$cat} += log($ratio);
|
||||
$sum->{$cat} += log($ratio) if ($ratio > 0.000001);
|
||||
++$indexed->{$cat};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user