diff options
author | P. J. McDermott <pj@pehjota.net> | 2017-01-17 14:38:44 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2017-01-17 14:38:44 (EST) |
commit | 7a49c97846564d4a099db13bbf1bd2016891e879 (patch) | |
tree | 6455d3ad4a5045ff11cac1350417f662a45c57dd /lib | |
parent | 5fe61f6effa077552b8986f7b21291e25b3bb769 (diff) | |
download | Math-Decimal-FastPP-7a49c97846564d4a099db13bbf1bd2016891e879.zip Math-Decimal-FastPP-7a49c97846564d4a099db13bbf1bd2016891e879.tar.gz Math-Decimal-FastPP-7a49c97846564d4a099db13bbf1bd2016891e879.tar.bz2 |
drhtz(), drhfz(): Replace postfix control structures
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Math/Decimal/FastPP.pm | 8 |
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]) . "." . |