The stupid question is the question not asked PerlMonks

### Ln calculation

by dicty (Sexton)
 on Feb 05, 2013 at 17:39 UTC Need Help??
dicty has asked for the wisdom of the Perl Monks concerning the following question:

How to calculate Ln(X) with Perl? Is there any available Perl module for Ln calculation?

Thanks!

Dicty

Replies are listed 'Best First'.
Re: Ln calculation
by Arunbear (Parson) on Feb 05, 2013 at 17:45 UTC
Re: Ln calculation
by Old_Gray_Bear (Bishop) on Feb 05, 2013 at 19:22 UTC
What do you mean by "Ln(x)"? There are several polynomial series that fit that nomenclature:
1. Laguerre polynomials
2. Laurent polynomials
3. Littlewood polynomials
4. Legendre polynomials
5. etc
If you mean "ln(x)", then use the transformation rules to go from the log(x) (base 10) to ln(x) (base e).

----
I Go Back to Sleep, Now.

OGB

Re: Ln calculation
by spandox (Novice) on Feb 05, 2013 at 21:28 UTC
As a reply I will just copy a excerpt from the manual:

log EXPR

log

Returns the natural logarithm (base e) of EXPR. If EXPR is omitted, returns the 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.

Create A New User
Node Status?
node history
Node Type: perlquestion [id://1017231]
Front-paged by Arunbear
help
Chatterbox?
 [1nickt]: jdporter Maybe try IPC::Run3 [LanX]: Sandy Koufax is indeed rude. .. oO [chacham]: Re: Re: pattern matching -- feeling stoopit a poll idea about centrists, is +8 -5, used to be +6/-6 how apropos :)is +8 [chacham]: [chacham]: ooh, late, nighty nite everybody

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2017-05-24 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My favorite model of computation is ...

Results (186 votes). Check out past polls.