Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Real.sign(Real:U:).
  • Loading branch information
colomon committed Jul 26, 2011
1 parent 10d4051 commit 9c39731
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Real.pm
Expand Up @@ -3,7 +3,9 @@ class Complex { ... }
# XxX role Real does Numeric { ... }
my class Real {
method abs() { self < 0 ?? -self !! self }
method sign() { self < 0 ?? -1 !! self == 0 ?? 0 !! 1 }
proto method sign(|$) {*}
multi method sign(Real:U:) { Mu }
multi method sign(Real:D:) { self < 0 ?? -1 !! self == 0 ?? 0 !! 1 }
method sqrt() { self.Bridge.sqrt }
method sin() { self.Bridge.sin }
method cos() { self.Bridge.cos }
Expand Down

0 comments on commit 9c39731

Please sign in to comment.