Skip to content

Commit

Permalink
move log10 to setting
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 29, 2009
1 parent 43dfde2 commit d014a99
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/builtins/math.pir
Expand Up @@ -58,20 +58,6 @@ Returns the sign of $x, i.e +1 for positive numbers (including Inf), zero for ze
.end


=item log10

&log10 := &log.assuming:base(10);

Returns the base 10 logarithm of $x.

=cut

.sub 'log10'
.param num a
$N0 = log10 a
.return ($N0)
.end


=item e

Expand Down
1 change: 1 addition & 0 deletions src/setting/Any-num.pm
Expand Up @@ -190,6 +190,7 @@ class Any is also {
multi sub abs($x) { (+$x).abs() }
multi sub exp($x) { $x.Num.exp() }
multi sub log($x) { $x.Num.log() }
multi sub log10($x) { $x.Num.log10 }

our Num sub rand (*@args) {
die "too many arguments passed - 0 params expected" if @args;
Expand Down
8 changes: 8 additions & 0 deletions src/setting/Num.pm
Expand Up @@ -224,6 +224,14 @@ class Num is also {
}
}

our method log10 {
Q:PIR {
$N0 = self
$N0 = log10 $N0
%r = box $N0
}
}
our Str multi method perl() {
~self
}
Expand Down

0 comments on commit d014a99

Please sign in to comment.