Skip to content
Permalink
Browse files

Fix Rational.norm

It assumes the Rationals are always reduced, however, that's not the
case for optimization reasons.

Fix by reducing before returning self.

Bug find: https://irclog.perlgeek.de/perl6/2017-02-13#i_14092899
  • Loading branch information...
zoffixznet committed Feb 13, 2017
1 parent 9841313 commit aac9efcbda6a191c9ef8ef232cfa7fa639722a10
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/Rational.pm
@@ -201,7 +201,7 @@ my role Rational[::NuT, ::DeT] does Real {
self.new($!numerator - $!denominator, $!denominator);
}

method norm() { self }
method norm() { self.REDUCE-ME; self }

method narrow(::?CLASS:D:) {
self.REDUCE-ME;

0 comments on commit aac9efc

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