routine log
Documentation for routine log
assembled from the following types:
class Numeric
From Numeric
(Numeric) routine log
multi sub log(Numeric, Numeric = e --> Numeric)multi method log(Numeric: Numeric = e --> Numeric)
Calculates the logarithm to base $base
. Defaults to the natural logarithm. Returns NaN
if $base
is negative. Throws an exception if $base
is 1
.
class Cool
From Cool
(Cool) routine log
Defined as:
multi sub log(Numeric(Cool) , Numeric(Cool) ?)multi method log(Cool: Cool ?)
Coerces the arguments (including the invocant in the method form) to Numeric, and returns its Logarithm to base $base
, or to base e
(Euler's Number) if no base was supplied (Natural logarithm). Returns NaN
if $base
is negative. Throws an exception if $base
is 1
.
say (e*e).log; # OUTPUT: «2»