summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Math/Decimal/FastPP.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Math/Decimal/FastPP.pm b/lib/Math/Decimal/FastPP.pm
index cc516e1..0dca737 100644
--- a/lib/Math/Decimal/FastPP.pm
+++ b/lib/Math/Decimal/FastPP.pm
@@ -165,9 +165,9 @@ sub drhtz
my ($ai, $af, $ad) = $_[0] =~ m/^(.*)\.(.{$_[1]})(.*)$/ or return;
my $as = $ai . $af;
if ($as >= 0) {
- ++$as if $ad > "5" . "0" x (length($ad) - 1);
+ if ($ad > "5" . "0" x (length($ad) - 1)) { ++$as; }
} else {
- --$as if $ad > "5" . "0" x (length($ad) - 1);
+ if ($ad > "5" . "0" x (length($ad) - 1)) { --$as; }
}
$as = sprintf("%0$_[1]i", $as);
return substr($as, 0, length($as) - $_[1]) . "." .
@@ -196,9 +196,9 @@ sub drhfz
my ($ai, $af, $ad) = $_[0] =~ m/^(.*)\.(.{$_[1]})(.*)$/ or return;
my $as = $ai . $af;
if ($as >= 0) {
- ++$as if $ad >= "5" . "0" x (length($ad) - 1);
+ if ($ad >= "5" . "0" x (length($ad) - 1)) { ++$as; }
} else {
- --$as if $ad >= "5" . "0" x (length($ad) - 1);
+ if ($ad >= "5" . "0" x (length($ad) - 1)) { --$as; }
}
$as = sprintf("%0$_[1]i", $as);
return substr($as, 0, length($as) - $_[1]) . "." .