Exp v0.1.0
Returns e raised to a power.
Package: Math
Signature
func Exp(x: float64) -> float64;
func Exp(x: float32) -> float32;
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | The exponent. |
Returns
e^x, in the same precision as the argument. Exp overflows to +Inf for
large positive x and underflows to +0.0 for large negative x.
Exp(+Inf) is +Inf, Exp(-Inf) is +0.0, and a NaN propagates.
Example
import Math::Exp;
func Main() -> int {
let a = Exp(1.0); // 2.718281828459045 (e)
let b = Exp(0.0); // 1.0
return 0;
}