Math: Difference between revisions
Jump to navigation
Jump to search
Fernando187 (talk | contribs) m (add math.randomseed(os.time()) tip) |
m (Fixed a typo. It should be randomseed and not random itself.) |
||
Line 25: | Line 25: | ||
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.rad math.rad] | * [http://www.lua.org/manual/5.1/manual.html#pdf-math.rad math.rad] | ||
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.random math.random] | * [http://www.lua.org/manual/5.1/manual.html#pdf-math.random math.random] | ||
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.randomseed math.randomseed] | |||
Do this beforehand to improve randomness: | Do this beforehand to improve randomness: | ||
<syntaxhighlight lang="lua">math. | <syntaxhighlight lang="lua">math.randomseed(os.time())</syntaxhighlight> | ||
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.sin math.sin] | * [http://www.lua.org/manual/5.1/manual.html#pdf-math.sin math.sin] | ||
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.sinh math.sinh] | * [http://www.lua.org/manual/5.1/manual.html#pdf-math.sinh math.sinh] |
Revision as of 17:43, 28 February 2023
Math is a built-in Lua library which contains mathematical functions and constants that you can use in scripts.
- math.abs
- math.acos
- math.asin
- math.atan
- math.atan2
- math.ceil
- math.cos
- math.cosh
- math.deg
- math.exp
- math.floor
- math.fmod
- math.frexp
- math.huge (constant)
- math.ldexp
- math.log
- math.log10
- math.max
- math.min
- math.modf
- math.pi (constant)
- math.pow
- math.rad
- math.random
- math.randomseed
Do this beforehand to improve randomness:
math.randomseed(os.time())