Skip to content

Commit

Permalink
Remove pessimation of .round($x)
Browse files Browse the repository at this point in the history
Also using a literal param in MMD, which is still not optimized away.
  • Loading branch information
lizmat committed Oct 18, 2014
1 parent 45bac9b commit a9dea39
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/core/Int.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ my class Int does Real { # declared in BOOTSTRAP
method ceiling(Int:D:) { self }
proto method round(|) {*}
multi method round(Int:D:) { self }
multi method round(Int:D: 1) { self }
multi method round(Int:D: $scale as Real) { (self / $scale + 1/2).floor * $scale }

method lsb(Int:D:) {
Expand Down
3 changes: 0 additions & 3 deletions src/core/Real.pm
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ my role Real does Numeric {
multi method round(Real:D:) {
(self + 1/2).floor; # Rat NYI here, so no .5
}
multi method round(Real:D: 1) {
(self + 1/2).floor;
}
multi method round(Real:D: $scale as Real) {
(self / $scale + 1/2).floor * $scale;
}
Expand Down

0 comments on commit a9dea39

Please sign in to comment.