Exponentials and logarithms
| Function | Signature | Description |
|---|---|---|
exp | (x: f64) => f64 | e^x |
log | (x: f64) => f64 | Natural logarithm |
log10 | (x: f64) => f64 | Base-10 logarithm |
log2 | (x: f64) => f64 | Base-2 logarithm |
pow | (base: f64, exp: f64) => f64 | Power |
exp()
Returns Euler's number e raised to the power of x.
Signature
exp(x: f64): f64tyrus
const value: f64 = 1.0;
const result: f64 = exp(value);
print(result); // ~2.7183 (e^1)log()
Returns the natural logarithm (base e) of x.
Signature
log(x: f64): f64tyrus
const value: f64 = 2.7183;
const result: f64 = log(value);
print(result); // ~1.0 (ln(e))log10()
Returns the base-10 logarithm of x.
Signature
log10(x: f64): f64tyrus
const value: f64 = 100.0;
const result: f64 = log10(value);
print(result); // 2.0log2()
Returns the base-2 logarithm of x.
Signature
log2(x: f64): f64tyrus
const value: f64 = 8.0;
const result: f64 = log2(value);
print(result); // 3.0pow()
Returns base raised to the power of exp.
Signature
pow(base: f64, exp: f64): f64tyrus
const base: f64 = 2.0;
const exp: f64 = 3.0;
const result: f64 = pow(base, exp);
print(result); // 8.0