Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created February 9, 2017 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/043124ef58a020ec8ec719c904b9ea6a to your computer and use it in GitHub Desktop.
Save zoffixznet/043124ef58a020ec8ec719c904b9ea6a to your computer and use it in GitHub Desktop.
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ gd
diff --git a/src/core/Num.pm b/src/core/Num.pm
index b122621..d1ad252 100644
--- a/src/core/Num.pm
+++ b/src/core/Num.pm
@@ -337,25 +337,17 @@ multi sub infix:<*>(num $a, num $b) returns num {
}
multi sub infix:</>(Num:D \a, Num:D \b) {
- b
- ?? nqp::p6box_n(nqp::div_n(nqp::unbox_n(a), nqp::unbox_n(b)))
- !! Failure.new(X::Numeric::DivideByZero.new(:using</>, :numerator(a)))
+ nqp::p6box_n(nqp::div_n(nqp::unbox_n(a), nqp::unbox_n(b)))
}
multi sub infix:</>(num $a, num $b) returns num {
- $b
- ?? nqp::div_n($a, $b)
- !! Failure.new(X::Numeric::DivideByZero.new(:using</>, :numerator($a)))
+ nqp::div_n($a, $b)
}
multi sub infix:<%>(Num:D \a, Num:D \b) {
- b
- ?? nqp::p6box_n(nqp::mod_n(nqp::unbox_n(a), nqp::unbox_n(b)))
- !! Failure.new(X::Numeric::DivideByZero.new(:using<%>, :numerator(a)))
+ nqp::p6box_n(nqp::mod_n(nqp::unbox_n(a), nqp::unbox_n(b)))
}
multi sub infix:<%>(num $a, num $b) returns num {
- $b
- ?? nqp::mod_n($a, $b)
- !! Failure.new(X::Numeric::DivideByZero.new(:using<%>, :numerator($a)))
+ nqp::mod_n($a, $b)
}
# (If we get 0 here, must be underflow, since floating overflow provides Inf.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment