Skip to content

Commit

Permalink
Remove unnecessary branch in .truncate
Browse files Browse the repository at this point in the history
This fixes the difference between `True.truncate` (which returns True)
and `False.truncate` (which returned 0) so they both return self.
  • Loading branch information
MasterDuke17 committed Sep 21, 2020
1 parent 8e6f7f0 commit 7192a99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.c/Real.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ my role Real does Numeric {
proto method exp(|) {*}
multi method exp(Real:D: ) { self.Bridge.exp }
method truncate(Real:D:) {
self == 0 ?? 0 !! self < 0 ?? self.ceiling !! self.floor
self < 0 ?? self.ceiling !! self.floor
}
method isNaN { Bool::False }

Expand Down

0 comments on commit 7192a99

Please sign in to comment.