Difference between revisions of "RandomGenerator:getSeed"
m (moved RandomGenerator:getState to RandomGenerator:getSeed: Renamed) |
(Renamed) |
||
Line 1: | Line 1: | ||
{{newin|[[0.9.0]]|090|type=function}} | {{newin|[[0.9.0]]|090|type=function}} | ||
− | Gets the | + | Gets the seed of the random number generator object. |
− | The | + | The seed is split into two numbers due to Lua's use of [http://en.wikipedia.org/wiki/Double-precision_floating-point_format doubles] for all number values - doubles can't accurately represent integer values above 2^53, but the seed value is an integer number in the range of [0, 2^64 - 1]. |
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | low, high = RandomGenerator: | + | low, high = RandomGenerator:getSeed( ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
None. | None. | ||
=== Returns === | === Returns === | ||
− | {{param|number|low|Integer number representing the lower 32 bits of the RandomGenerator's 64 bit | + | {{param|number|low|Integer number representing the lower 32 bits of the RandomGenerator's 64 bit seed value.}} |
− | {{param|number|high|Integer number representing the higher 32 bits of the RandomGenerator's 64 bit | + | {{param|number|high|Integer number representing the higher 32 bits of the RandomGenerator's 64 bit seed value.}} |
== See Also == | == See Also == | ||
* [[parent::RandomGenerator]] | * [[parent::RandomGenerator]] | ||
− | * [[RandomGenerator: | + | * [[RandomGenerator:setSeed]] |
* [[love.math]] | * [[love.math]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description=Gets the | + | {{#set:Description=Gets the seed of the random number generator.}} |
== Other Languages == | == Other Languages == | ||
− | {{i18n|RandomGenerator: | + | {{i18n|RandomGenerator:getSeed}} |
Latest revision as of 03:00, 2 December 2013
Available since LÖVE 0.9.0 |
This function is not supported in earlier versions. |
Gets the seed of the random number generator object.
The seed is split into two numbers due to Lua's use of doubles for all number values - doubles can't accurately represent integer values above 2^53, but the seed value is an integer number in the range of [0, 2^64 - 1].
Function
Synopsis
low, high = RandomGenerator:getSeed( )
Arguments
None.
Returns
number low
- Integer number representing the lower 32 bits of the RandomGenerator's 64 bit seed value.
number high
- Integer number representing the higher 32 bits of the RandomGenerator's 64 bit seed value.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info