aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruser-person <60802990+user-person@users.noreply.github.com>2020-02-16 04:40:27 -0500
committerGitHub <noreply@github.com>2020-02-16 04:40:27 -0500
commitf56f5718190175a80081bde5966a92ec27f649ee (patch)
treeeca4fbc8d1feb4ea5dd2e8e83a755e9f7714d33d
parentca0bcb9dc1b66cbb1fefa71b8e647614f640bfb4 (diff)
downloadperlweeklychallenge-club-f56f5718190175a80081bde5966a92ec27f649ee.tar.gz
perlweeklychallenge-club-f56f5718190175a80081bde5966a92ec27f649ee.tar.bz2
perlweeklychallenge-club-f56f5718190175a80081bde5966a92ec27f649ee.zip
Update ch-1.pl
-rw-r--r--challenge-047/user-person/perl/ch-1.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/challenge-047/user-person/perl/ch-1.pl b/challenge-047/user-person/perl/ch-1.pl
index 6dc09d1bfb..ec2e27b494 100644
--- a/challenge-047/user-person/perl/ch-1.pl
+++ b/challenge-047/user-person/perl/ch-1.pl
@@ -43,7 +43,9 @@ print STDERR "Calculation result had a decimal $decimal that was truncated.\n" i
if ( $result == 0) {
print "N (no formal zero)\n"; # https://en.wikipedia.org/wiki/Roman_numerals#Zero
} elsif ($result > 3_999) {
- die "Calculation result $result , exceeds MMMCMXCIX (3,999) the maximum value of the Roman number format.\n";
+ die "Calculation result $result exceeds MMMCMXCIX (3,999) the maximum value of the Roman number format.\n";
+} elsif ($result < 0) {
+ die "Calculation result $result is negative. Roman numbers are positive integers.\n";
} else {
$result = Roman(int $result);
print "$result\n";