Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cosech and acosech.
  • Loading branch information
colomon committed Aug 15, 2011
1 parent 4a2f261 commit a61f7d4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/core/Complex.pm
Expand Up @@ -170,14 +170,14 @@ my class Complex is Numeric {
(1 / self).acosh;
}

# method cosech(Complex:D:) {
# 1 / self.sinh;
# }
#
# method acosech(Complex:D:) {
# (1 / self).asinh;
# }
#
method cosech(Complex:D:) {
1 / self.sinh;
}

method acosech(Complex:D:) {
(1 / self).asinh;
}

# method cotanh(Complex:D:) {
# 1 / self.tanh;
# }
Expand Down
2 changes: 2 additions & 0 deletions src/core/Cool.pm
Expand Up @@ -25,6 +25,8 @@ my class Cool {
method atanh() { self.Numeric.atanh }
method sech() { self.Numeric.sech }
method asech() { self.Numeric.asech }
method cosech() { self.Numeric.cosech }
method acosech() { self.Numeric.acosech }

## string methods

Expand Down
8 changes: 8 additions & 0 deletions src/core/Num.pm
Expand Up @@ -166,6 +166,14 @@ my class Num {
multi method asech(Num:D: ) {
(1 / self).acosh;
}
proto method cosech(|$) {*}
multi method cosech(Num:D: ) {
nqp::p6box_n(nqp::div_n(1, pir::sinh__NN(nqp::unbox_n(self))));
}
proto method acosech(|$) {*}
multi method acosech(Num:D: ) {
(1 / self).asinh;
}
}

my constant pi = 3.14159265e0;
Expand Down
8 changes: 8 additions & 0 deletions src/core/Numeric.pm
Expand Up @@ -132,6 +132,14 @@ proto sub asech(|$) {*}
multi sub asech(Numeric \$x) { $x.asech }
multi sub asech(Cool \$x) { $x.Numeric.asech }

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

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

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 @@ -31,6 +31,8 @@ my class Real {
method atanh() { self.Bridge.atanh }
method sech() { self.Bridge.sech }
method asech() { self.Bridge.asech }
method cosech() { self.Bridge.cosech }
method acosech() { self.Bridge.acosech }
method floor() { self.Bridge.floor }
method ceiling() { self.Bridge.ceiling }
method unpolar(Real $angle) {
Expand Down

0 comments on commit a61f7d4

Please sign in to comment.