BTW, there is other package exporting log10: Math::Libm

Maybe the correct aproach would be to create the Math package with all those common math functions not included in the perl core and pack it also in the Perl distribution. i.e.

use Math qw(log10 PI E);

Bye,

- Salva


Ken Williams wrote:
On Saturday, February 1, 2003, at 10:15  AM, Salvador Fandi�o wrote:

Hi


By the way - here is my version. Just store it in some $PERL5LIB/Math/Log10.pm:
sub log10
{
return log(shift)/log(10);
}
1;


If speed is what you want, then

  use constant ILOG10 => 0.434294481903252; # 1.0/log(10.0)

  sub log10 { ILOG10*log(shift) }

That doesn't do much good. Look at this one-liner:

% perl -MO=Deparse -e '$x = log($y)/log(10)'
$x = log($y) / 2.30258509299405;
-e syntax OK
%

This shows that perl does constant-folding on the log(10) at compile-time anyway.


or even use

  ILOG10*log($anything)

in your code without calling any sub

Yeah, that could help.

 -Ken





Reply via email to