Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

make log.t pass again

  • Loading branch information...
commit c14785bb303705977de9cafd4df8d97127943478 1 parent 3cae1b4
Moritz Lenz authored July 04, 2011
11  src/core/Numeric.pm
@@ -5,6 +5,11 @@ my class Numeric {
5 5
     multi method ACCEPTS(Numeric:D: $a) { $a == self }
6 6
 
7 7
     proto method log(|$) {*}
  8
+    multi method log(Cool    $base) { self.log / $base.Numeric.log }
  9
+    multi method log(Numeric $base) { self.log / $base.log         }
  10
+
  11
+    method log10() { self.log / 10e0.log }
  12
+
8 13
     proto method exp(|$) {*}
9 14
     multi method exp(Numeric $base) {
10 15
         self.exp * $base.log;
@@ -26,6 +31,12 @@ multi prefix:<abs>(\$a)      { abs $a.Numeric }
26 31
 proto sub log(|$) {*}
27 32
 multi sub log(Numeric $x) { $x.log }
28 33
 multi sub log(Numeric $x, Numeric $base) { $x.log($base) }
  34
+multi sub log(Cool $x)    { $x.Numeric.log }
  35
+multi sub log(Cool $x, Cool $base) { $x.Numeric.log($base.Numeric) }
  36
+
  37
+proto sub log10(|$) {*}
  38
+multi sub log10(Numeric $x) { $x.log(10e0) }
  39
+multi sub log10(Cool    $x) { $x.Numeric.log(10e0) }
29 40
 
30 41
 proto sub exp(|$) {*}
31 42
 multi sub exp(Numeric $x) { $x.exp }
2  t/spectest.data
@@ -520,7 +520,7 @@ S32-num/complex.t
520 520
 # S32-num/exp.t
521 521
 # S32-num/gcd.t
522 522
 # S32-num/int.t
523  
-# S32-num/log.t
  523
+S32-num/log.t
524 524
 # S32-num/pi.t
525 525
 S32-num/polar.t
526 526
 # S32-num/power.t

0 notes on commit c14785b

Please sign in to comment.
Something went wrong with that request. Please try again.