15 lines
378 B
Raku
15 lines
378 B
Raku
sub MAIN (
|
|
$num1, #= Number to perform arithmatic on
|
|
$num2 #= Second number to perform arithmatic on
|
|
) {
|
|
die "unexpected input" unless is-numeric($num1) and is-numeric($num2);
|
|
say "sum is {$num1 + $num2}";
|
|
say "difference is {$num1 - $num2}";
|
|
say "product is {$num1 * $num2}";
|
|
say "quotient is {$num1 / $num2}";
|
|
}
|
|
|
|
sub is-numeric ($num) {
|
|
return val($num) ~~ Numeric;
|
|
}
|