Skip to content

Commit

Permalink
Test::Builder::_normalize handle inf/nan
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Sep 21, 2012
1 parent 34915f8 commit 1be8ab8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Parrot/Test.pm
Expand Up @@ -1169,6 +1169,8 @@ sub _normalize {
if ($s =~ /^(.*)(\d)e(.+)/) { # strip overlong numbers
# and round last digit
$s = $1.($2 <5 ? '0e' : '5e').$3;
} elsif ($s =~ /inf|nan|Inf|NaN/) {
return $s;
} else {
$s = substr($s, 0, $prec-1).round(substr($s, $prec, 1));
}
Expand Down

0 comments on commit 1be8ab8

Please sign in to comment.