I don't like having to constantly define my own log10 function.  This method is also 
rather unoptimized.
--
 perldoc -f log
     log EXPR
     log     Returns the natural logarithm (base e) of EXPR.  If
             EXPR is omitted, returns log of $_.  To get the log
             of another base, use basic algebra:  The base-N log
             of a number is equal to the natural log of that
             number divided by the natural log of N.  For
             example:

                 sub log10 {
                     my $n = shift;
                     return log($n)/log(10);
                 }

             See also "exp" for the inverse operation.
--
There is an all Perl implementation of log10 in Math::Complex and the standard C math 
lib's log10 function is included with the POSIX module.  However the POSIX module is 
rather large and I think it's a rather in-obvious place to look for a math function.  
So I'm proposing a simple module that allows access to the standard C math lib's: log, 
log10, exp, and pow functions.

Possible names are:
Math::Log
Math::Logarithm
Math::Logarithmic
...

-J


Reply via email to