aboutsummaryrefslogtreecommitdiff
path: root/challenge-179
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-179')
-rwxr-xr-xchallenge-179/jo-37/perl/ch-2.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/challenge-179/jo-37/perl/ch-2.pl b/challenge-179/jo-37/perl/ch-2.pl
index 4b0f69da83..5ff1c52ff4 100755
--- a/challenge-179/jo-37/perl/ch-2.pl
+++ b/challenge-179/jo-37/perl/ch-2.pl
@@ -2,7 +2,7 @@
use v5.16;
use List::MoreUtils 'minmax';
-use Math::Round 'round';
+use Math::Utils 'floor';
die <<EOS unless @ARGV;
usage: $0 N1 N2 ...
@@ -32,6 +32,6 @@ say barchart(@ARGV);
sub barchart {
my ($min, $max) = minmax @_;
- my $scale = 7 / (($max - $min) || 1);
- map chr(0x2581 + round(($_ - $min) * $scale)), @_;
+ my $scale = 7.999 / (($max - $min) || 1);
+ map chr(0x2581 + floor(($_ - $min) * $scale)), @_;
}