Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[src/core/Numeric.pm] made NaN ~~ NaN true
Borrowed the implementation from Beijing.
  • Loading branch information
Carl Masak committed Sep 9, 2011
1 parent 6c2607a commit 88e14a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Numeric.pm
Expand Up @@ -2,7 +2,9 @@
my class Numeric {
multi method Numeric(Numeric:D:) { self }

multi method ACCEPTS(Numeric:D: $a) { $a == self }
multi method ACCEPTS(Numeric:D: $a) {
self.isNaN ?? $a.isNaN !! $a == self;
}

proto method log(|$) {*}
multi method log(Cool $base) { self.log / $base.Numeric.log }
Expand Down

0 comments on commit 88e14a0

Please sign in to comment.