Difference between revisions of "Math.exp"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === returns e^v <source lang="lua"> (number), = math.exp(v,) </source> '''v:''' (number) level of exponent...")
 
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[math]]<br/>
 +
 
=== Description ===
 
=== Description ===
returns e^v
+
Returns e^v.
<source lang="lua">
+
<syntaxhighlight lang="lua">
(number), = math.exp(v,)
+
(number) = math.exp(v)
</source>
+
</syntaxhighlight>
'''v:''' (number) level of exponentiation for e ''''''<br/>
+
 
 +
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<br/>
 +
 
 +
=== Return values ===
 
'''Returns''' (number) result of exponentiation<br/>
 
'''Returns''' (number) result of exponentiation<br/>
 +
 +
=== Example ===
 +
'''Here is how to get the value of e in Lua'''
 +
<syntaxhighlight lang="lua">
 +
local e_value = math.exp(1)
 +
print(e_value) -- output will be approximately 2.718281828459
 +
</syntaxhighlight>
 +
 +
{{Math}}

Latest revision as of 08:40, 23 November 2025

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