Difference between revisions of "Log - Math"
Jump to navigation
Jump to search
m |
m (→Examples) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
== Syntax == | == Syntax == | ||
< | <source lang="papyrus"> | ||
float Function Log(float arg1) global native | |||
</source> | |||
== Parameters == | == Parameters == | ||
Line 17: | Line 19: | ||
== Examples == | == Examples == | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
float lnNum = Math.Log(5 | float lnNum = Math.Log(5.89) ; lnNum ≈ 1.773256 | ||
</source> | |||
<source lang="papyrus"> | |||
;/ there's no function that returns a simple logarithm, but you can easily calculate it | |||
by multiplying this function's return value by 0.434294 (logarithm of Euler's number) /; | |||
float logNum = (Math.Log(5.89)) * 0.434294 ; logNum ≈ 0.770114 (keep in mind, the result is not 100% accurate) | |||
</source> | </source> | ||
Latest revision as of 19:39, 13 July 2023
SKSE Member of: Math Script
Returns natural logarithm of passed argument as float value.
Syntax[edit | edit source]
float Function Log(float arg1) global native
Parameters[edit | edit source]
- arg1: The float value to calculate natural logarithm from.
Return Value[edit | edit source]
The natural logarithm of arg1.
Examples[edit | edit source]
float lnNum = Math.Log(5.89) ; lnNum ≈ 1.773256
;/ there's no function that returns a simple logarithm, but you can easily calculate it
by multiplying this function's return value by 0.434294 (logarithm of Euler's number) /;
float logNum = (Math.Log(5.89)) * 0.434294 ; logNum ≈ 0.770114 (keep in mind, the result is not 100% accurate)
Notes[edit | edit source]
- Despite its name, this function returns natural logarithm of the number (ln), and not simple logarithm (log).