Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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?



Replies are listed 'Best First'.
Re: Ln calculation
by Arunbear (Prior) 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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2018-04-21 08:32 GMT
Find Nodes?
    Voting Booth?