From 7a49c97846564d4a099db13bbf1bd2016891e879 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 17 Jan 2017 14:38:44 -0500 Subject: drhtz(), drhfz(): Replace postfix control structures --- 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]) . "." . -- cgit v0.9.1