validate arguments to percenterror

master
Michael Smith 2012-03-22 07:55:57 -06:00
parent 369366e92f
commit 52282a3cbb
1 changed files with 1 additions and 0 deletions

View File

@ -16,6 +16,7 @@ handle query_parts => sub {
my ( $acc, $exp ) = @_;
$acc =~ s/[{},;\s]+//g;
$exp =~ s/[{},;\s]+//g;
return unless $acc =~ /^\d$/ && $exp =~ /^\d$/;
my $diff = abs $acc - $exp;
my $err = abs ($diff/$acc*100);