Function exp #
Calculate the exponential of a value.
For matrices, if you want the matrix exponential of square matrix, use
the expm function; if you want to take the exponential of each element,
see the examples.
Syntax #
Parameters #
| Parameter |
Type |
Description |
x |
number | BigNumber | Complex |
A number to exponentiate |
Returns #
| Type |
Description |
| number | BigNumber | Complex |
Exponential of x |
Throws #
Type | Description
—- | ———–
Examples #
math.exp(2) // returns number 7.3890560989306495
math.pow(math.e, 2) // returns number 7.3890560989306495
math.log(math.exp(2)) // returns number 2
math.map([1, 2, 3], math.exp)
// returns [2.718281828459045, 7.3890560989306495, 20.085536923187668]
See also #
expm1,
expm,
log,
pow
History #
| Version |
Comment |
| v11 |
Don’t apply elementwise, avoid confusion with matrix exponential |
| v0.20 |
Handle BigNumbers |
| v0.0.2 |
Created |