Skip to content

Commit

Permalink
cotan and acotan.
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Aug 15, 2011
1 parent 8da71aa commit 9e8adcc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/Cool.pm
Expand Up @@ -15,6 +15,8 @@ my class Cool {
method asec() { self.Numeric.asec }
method cosec() { self.Numeric.cosec }
method acosec() { self.Numeric.acosec }
method cotan() { self.Numeric.cotan }
method acotan() { self.Numeric.acotan }

## string methods

Expand Down
6 changes: 6 additions & 0 deletions src/core/Num.pm
Expand Up @@ -128,6 +128,12 @@ my class Num {
method acosec(Num:D:) {
nqp::p6box_n(pir::asin__NN(nqp::div_n(1, nqp::unbox_n(self))));
}
method cotan(Num:D:) {
nqp::p6box_n(nqp::div_n(1, pir::tan__NN(nqp::unbox_n(self))));
}
method acotan(Num:D:) {
nqp::p6box_n(pir::atan__NN(nqp::div_n(1, nqp::unbox_n(self))));
}
proto method sinh(|$) {*}
multi method sinh(Num:D: ) {
nqp::p6box_n(pir::sinh__NN(nqp::unbox_n(self)));
Expand Down
8 changes: 8 additions & 0 deletions src/core/Numeric.pm
Expand Up @@ -92,6 +92,14 @@ proto sub acosec(|$) {*}
multi sub acosec(Numeric \$x) { $x.acosec }
multi sub acosec(Cool \$x) { $x.Numeric.acosec }

proto sub cotan(|$) {*}
multi sub cotan(Numeric \$x) { $x.cotan }
multi sub cotan(Cool \$x) { $x.Numeric.cotan }

proto sub acotan(|$) {*}
multi sub acotan(Numeric \$x) { $x.acotan }
multi sub acotan(Cool \$x) { $x.Numeric.acotan }

proto sub sqrt(|$) {*}
multi sub sqrt(Numeric \$x) { $x.sqrt }
multi sub sqrt(Cool \$x) { $x.Numeric.sqrt }
Expand Down
2 changes: 2 additions & 0 deletions src/core/Real.pm
Expand Up @@ -14,6 +14,8 @@ my class Real {
method acos() { self.Bridge.acos }
method tan() { self.Bridge.tan }
method atan() { self.Bridge.atan }
method cotan() { self.Bridge.cotan }
method acotan() { self.Bridge.acotan }
method sinh() { self.Bridge.sinh }
method cosh() { self.Bridge.cosh }
method tanh() { self.Bridge.tanh }
Expand Down

0 comments on commit 9e8adcc

Please sign in to comment.