Log v0.1.0
Returns the natural logarithm.
Package: Math
Signature
func Log(x: float64) -> float64;
func Log(x: float32) -> float32;
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | A non-negative value. |
Returns
ln(x), in the same precision as the argument. Log(±0.0) is -Inf;
Log of a negative value is a NaN; Log(+Inf) is +Inf; a NaN propagates.
Example
import Math::{ E, Log };
func Main() -> int {
let a = Log(E); // 1.0
let b = Log(1.0); // 0.0
return 0;
}