File Coverage

lib/Spreadsheet/Engine/Function/LOG.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition 2 2 100.0
subroutine 7 7 100.0
pod 3 3 100.0
total 27 27 100.0


line stmt bran cond sub pod time code
1             package Spreadsheet::Engine::Function::LOG;
2              
3 28     28   151 use strict;
  28         58  
  28         1019  
4 28     28   146 use warnings;
  28         60  
  28         721  
5              
6 28     28   136 use base 'Spreadsheet::Engine::Fn::math';
  28         63  
  28         5277  
7              
8 285     285 1 891 sub argument_count { -1 => 2 }
9 285     285 1 1002 sub signature { '>0', '>0' }
10 285     285   1063 sub _result_type_key { 'oneargnumeric' }
11              
12             sub calculate {
13 240     240 1 7939 my ($self, $value, $base) = @_;
14 240   100     1019 $base ||= 10;
15 240         6391 return log($value) / log($base);
16             }
17              
18             1;
19              
20             __END__