diff options
| author | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2022-08-26 16:48:16 +0200 |
|---|---|---|
| committer | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2022-08-26 16:50:14 +0200 |
| commit | 138e6f00cd7a994f5e63d403c40eb94faa76abd3 (patch) | |
| tree | 77aca1e1971394060e52027755820ad86f46b0f8 /challenge-179 | |
| parent | 62b7679d5489db7b651dd8fa9c2e429299205a19 (diff) | |
| download | perlweeklychallenge-club-138e6f00cd7a994f5e63d403c40eb94faa76abd3.tar.gz perlweeklychallenge-club-138e6f00cd7a994f5e63d403c40eb94faa76abd3.tar.bz2 perlweeklychallenge-club-138e6f00cd7a994f5e63d403c40eb94faa76abd3.zip | |
Fix for task 2
Diffstat (limited to 'challenge-179')
| -rwxr-xr-x | challenge-179/jo-37/perl/ch-2.pl | 6 |
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)), @_; } |
