Difference between revisions of "Math.exp"

From GiderosMobile
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
=== <translate>Description</translate> ===
+
'''Class:''' [[math]]<br/>
<translate>returns e^v</translate>
+
 
<source lang="lua">
+
=== Description ===
 +
Returns e^v.
 +
<syntaxhighlight lang="lua">
 
(number) = math.exp(v)
 
(number) = math.exp(v)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''v''': (number) <translate>level of exponentiation for e</translate> <br/>
+
Math.E is a constant that represents Euler's number, the base of the natural logarithm, approximately 2.71828.
=== <translate>Return values</translate> ===
+
 
'''<translate>Returns</translate>''' (number) <translate>result of exponentiation</translate><br/>
+
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/>
 +
 
 +
=== 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