Math.exp
From GiderosMobile
Available since: Gideros 2011.6
Class: math
Description
Returns e^v.
(number) = math.exp(v)
Math.E is a constant that represents Euler's number, the base of the natural logarithm, approximately 2.71828.
Lua does not have a direct equivalent constant named math.E.
However, you can obtain the value of e in Lua by utilizing the math.exp() function, which calculates e raised to a given power. To get the value of e itself, you would raise e to the power of 1.
Parameters
v: (number) level of exponentiation for e
Return values
Returns (number) result of exponentiation
Example
Here is how to get the value of e in Lua
local e_value = math.exp(1)
print(e_value) -- output will be approximately 2.718281828459
- Math
- Math.abs
- Math.acos
- Math.asin
- Math.atan
- Math.atan2
- Math.ceil
- Math.clamp
- Math.cos
- Math.cosh
- Math.cross
- Math.deg
- Math.distance
- Math.distances
- Math.dot
- Math.edge
- Math.exp
- Math.fft
- Math.floor
- Math.fmod
- Math.frexp
- Math.ifft
- Math.inside
- Math.ldexp
- Math.length
- Math.log
- Math.log10
- Math.max
- Math.min
- Math.modf
- Math.nearest
- Math.noise
- Math.normalize
- Math.pow
- Math.rad
- Math.random
- Math.randomseed
- Math.raycast
- Math.round
- Math.sign
- Math.sin
- Math.sinh
- Math.sqrt
- Math.tan
- Math.tanh