Skip to content

Commit

Permalink
Merge pull request #2019 from jkramer/issue-1746
Browse files Browse the repository at this point in the history
Always coerce first argument to &round to Numeric.
  • Loading branch information
zoffixznet committed Jul 4, 2018
2 parents e4e753b + e547811 commit 2f8074b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/Numeric.pm6
Expand Up @@ -197,9 +197,8 @@ multi sub ceiling($a) { $a.Numeric.ceiling }
multi sub ceiling(Numeric $a) { $a.ceiling }

proto sub round($, $?, *%) is pure {*}
multi sub round($a) { $a.Numeric.round }
multi sub round(Numeric $a) { $a.round }
multi sub round(Numeric $a, $scale) { $a.round($scale) }
multi sub round(Numeric() $a) { $a.round }
multi sub round(Numeric() $a, $scale) { $a.round($scale) }

proto sub infix:<+>($?, $?, *%) is pure {*}
multi sub infix:<+>($x = 0) { $x.Numeric }
Expand Down

0 comments on commit 2f8074b

Please sign in to comment.