Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

sec, asec

  • Loading branch information...
commit 9f86f98687eb3cd5841d0424f742c993b78b57c0 1 parent 607c1b8
@moritz moritz authored
View
2  src/core/Cool.pm
@@ -11,6 +11,8 @@ my class Cool {
method tan() { self.Numeric.tan }
method atan() { self.Numeric.atan }
method atan2($y = 1e0) { self.Numeric.atan2($y.Numeric) }
+ method sec() { self.Numeric.sec }
+ method asec() { self.Numeric.asec }
## string methods
View
8 src/core/Numeric.pm
@@ -76,6 +76,14 @@ proto sub atan(|$) {*}
multi sub atan(Numeric \$x) { $x.atan }
multi sub atan(Cool \$x) { $x.Numeric.atan }
+proto sub sec(|$) {*}
+multi sub sec(Numeric \$x) { $x.sec }
+multi sub sec(Cool \$x) { $x.Numeric.sec }
+
+proto sub asec(|$) {*}
+multi sub asec(Numeric \$x) { $x.asec }
+multi sub asec(Cool \$x) { $x.Numeric.asec }
+
proto sub sqrt(|$) {*}
multi sub sqrt(Numeric \$x) { $x.sqrt }
multi sub sqrt(Cool \$x) { $x.Numeric.sqrt }
View
2  src/core/Real.pm
@@ -20,6 +20,8 @@ my class Real {
proto method atan2(|$) {*}
multi method atan2(Real $x = 1e0) { self.Bridge.atan2($x.Bridge) }
multi method atan2(Cool $x = 1e0) { self.Bridge.atan2($x.Numeric.Bridge) }
+ method sec() { self.Bridge.sec }
+ method asec() { self.Bridge.asec }
method floor() { self.Bridge.floor }
method ceiling() { self.Bridge.ceiling }
method unpolar(Real $angle) {
View
2  t/spectest.data
@@ -574,7 +574,7 @@ S32-trig/pi.t
S32-trig/sin.t
S32-trig/cos.t
S32-trig/tan.t
-# S32-trig/sec.t # err: Method 'sec' not found for invocant of class 'Rat'
+S32-trig/sec.t
# S32-trig/cosec.t # err: Method 'cosec' not found for invocant of class 'Rat'
# S32-trig/cotan.t # err: Method 'cotan' not found for invocant of class 'Rat'
S32-trig/atan2.t
Please sign in to comment.
Something went wrong with that request. Please try again.