Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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?



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


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


    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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2015-11-27 01:13 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (710 votes), past polls