Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Ln calculation

by dicty (Sexton)
on Feb 05, 2013 at 17:39 UTC ( #1017231=perlquestion: print w/ replies, xml ) 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

Comment on Ln calculation
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1017231]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (20)
As of 2014-10-30 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls