Skip to content
Permalink
Browse files

Consistify Rat.base: fail instead of throw

Fixes R#2266 #2266
  • Loading branch information...
zoffixznet committed Oct 19, 2018
1 parent fc5b76a commit a804ab57f15d58e92f4c7f8ea7298c7bca371d7b
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/core/Rational.pm6
@@ -152,9 +152,8 @@ my role Rational[::NuT = Int, ::DeT = ::("NuT")] does Real {
method base($base, Any $digits? is copy) {
# XXX TODO: this $base check can be delegated to Int.base once Num/0 gives Inf/NaN,
# instead of throwing (which happens in the .log() call before we reach Int.base
2 <= $base <= 36 or Failure.new(X::OutOfRange.new(
what => "base argument to base", :got($base), :range<2..36>)
);
2 <= $base <= 36 or fail X::OutOfRange.new(
what => "base argument to base", :got($base), :range<2..36>);

my $prec;
if $digits ~~ Whatever {

0 comments on commit a804ab5

Please sign in to comment.
You can’t perform that action at this time.