Hi all,
I am experiencing a fatal error when I am trying to build. The error is an
illegal division by zero at /usr/asd/httpd/cgi-bin/test/li/nph-build.cgi,
line 439, cluster 5222. This situation just recently occured.
I think maybe in this line we can change from:
if (exists $votes{$id}) {
$values[$db_rating] = (($values[$db_rating] * $values[$db_votes]) + $rating{$id})/($values[$db_votes] + $votes{$id});
$values[$db_rating] = sprintf ("%.2f", $values[$db_rating]);
$values[$db_votes] = $values[$db_votes] + $votes{$id};
print "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
to :
if (exists $votes{$id}) {
if(($values[$db_votes] + $votes{$id}) != 0){
$values[$db_rating] = (($values[$db_rating] * $values[$db_votes]) + $rating{$id})/($values[$db_votes] + $votes{$id});
}
$values[$db_rating] = sprintf ("%.2f", $values[$db_rating]);
$values[$db_votes] = $values[$db_votes] + $votes{$id};
print "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
Any ideas?
Cheers,
Mark
I am experiencing a fatal error when I am trying to build. The error is an
illegal division by zero at /usr/asd/httpd/cgi-bin/test/li/nph-build.cgi,
line 439, cluster 5222. This situation just recently occured.
I think maybe in this line we can change from:
if (exists $votes{$id}) {
$values[$db_rating] = (($values[$db_rating] * $values[$db_votes]) + $rating{$id})/($values[$db_votes] + $votes{$id});
$values[$db_rating] = sprintf ("%.2f", $values[$db_rating]);
$values[$db_votes] = $values[$db_votes] + $votes{$id};
print "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
to :
if (exists $votes{$id}) {
if(($values[$db_votes] + $votes{$id}) != 0){
$values[$db_rating] = (($values[$db_rating] * $values[$db_votes]) + $rating{$id})/($values[$db_votes] + $votes{$id});
}
$values[$db_rating] = sprintf ("%.2f", $values[$db_rating]);
$values[$db_votes] = $values[$db_votes] + $votes{$id};
print "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
Any ideas?
Cheers,
Mark