Josh,

I don't think there would be a problem with using the namespace Math::Log10, but... I think there is a reason why it doesn't already exist.

The log() function built into Perl is natural log (base e). So if you want to compute log for any other base, just do something like:

log_n(200) = log(200) / log(n)

(where n = base, and log() is the standard built-in base e function)

I guess the way the core Perl people see it, is that if log base n can be computed from log base e (easily... just use division), then all you need to include as a standard function is log base e. Lets say you were to create a Math::Log10 module. Ideally, it would just be 2 or 3 lines of code that use the standard built-in log() function with the above formula.

If a Perl mod is only going to be a line or two, that its not really worth adding into a namespace and standard distribution.

John Von Essen




On Tuesday, January 28, 2003, at 05:14 PM, Joshua Hoblitt wrote:

However the POSIX module is rather large and I think it's a rather
in-obvious place to look for a math function.
I don't know; it's where I'd expect to see things which are in the
"standard C library" (whatever that means) but aren't directly available
as Perl functions.
I'm only really interested in log10 - this is something that (I feel) really should be a core function. As I said before, POSIX is a huge module to load for just one common function. I'd be willing to go with Math::Log10 and have nothing else in the module if the namespace people don't object.

-J




Reply via email to