Skip to content

Commit

Permalink
Add Int.sign so that we can take advantage of the fact our current In…
Browse files Browse the repository at this point in the history
…t cannot be NaN to drastically speed up Rat construction.
  • Loading branch information
colomon committed Jul 22, 2010
1 parent 12c5229 commit 9c4bd55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Int.pm
Expand Up @@ -25,6 +25,10 @@ augment class Int does Real {
our Num method Num() {
pir::box__PN(pir::set__NP(self));
}

method sign(Int $x:) {
$x <=> 0;
}
}

our multi sub prefix:<->(Int $a) {
Expand Down

0 comments on commit 9c4bd55

Please sign in to comment.