Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added inline PIR versions of Any.pm's lc, ceiling, floor and round to…
… the P6 Any.pm class. Squashed commit of the following: commit 59873f07aa08081cc2d5e915ce309d733935cb54 Author: Cory Spencer <cspencer@sprocket.org> Date: Thu Mar 19 18:19:21 2009 -0700 Added an inline PIR P6 version of lc commit 65b75d2b6266adaae8caac230cc55462467c8c0c Author: Cory Spencer <cspencer@sprocket.org> Date: Thu Mar 19 16:06:26 2009 -0700 Add inline PIR versions of round, ceiling and floor commit 9a873239e9a0fb86d4d11dc2f141d6081d2e1a23 Merge: 8592d17... f8b6aee... Author: Cory Spencer <cspencer@sprocket.org> Date: Thu Mar 19 14:28:57 2009 -0700 Merge branch 'master' of git://github.com/rakudo/rakudo Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
- Loading branch information
Showing
5 changed files
with
42 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class Any is also { | ||
our Int multi method ceiling (Num $x:) is export { | ||
return Q:PIR { | ||
$P0 = find_lex "$x" | ||
$N0 = $P0 | ||
$I0 = ceil $N0 | ||
%r = box $I0 | ||
} | ||
} | ||
our Int multi method floor (Num $x:) is export { | ||
return Q:PIR { | ||
$P0 = find_lex "$x" | ||
$N0 = $P0 | ||
$I0 = floor $N0 | ||
%r = box $I0 | ||
} | ||
} | ||
our Int multi method round (Num $x:) is export { | ||
return Q:PIR { | ||
$P0 = find_lex "$x" | ||
$N0 = $P0 | ||
$N0 = $N0 + 0.5 | ||
$I0 = floor $N0 | ||
%r = box $I0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters