{{newin|[[0.9.0]]|090|type=function}}
Generates a pseudo-random number in a platform independent manner. The default [[love.run]] seeds this function at startup, so you generally don't need to seed it yourself.

== Function ==
Get uniformly distributed pseudo-random real number within [0, 1].

=== Synopsis ===
<source lang="lua">
number = love.math.random( )
</source>
=== Arguments ===
None.
=== Returns ===
{{param|number|number|The pseudo-random number.}}

== Function ==
Get a uniformly distributed pseudo-random integer within [1, max].
=== Synopsis ===
<source lang="lua">
number = love.math.random( max )
</source>
=== Arguments ===
{{param|number|max|The maximum possible value it should return.}}
=== Returns ===
{{param|number|number|The pseudo-random integer number.}}
== Function ==
Get uniformly distributed pseudo-random integer within [min, max].
=== Synopsis ===
<source lang="lua">
number = love.math.random( min, max )
</source>
=== Arguments ===
{{param|number|min|The minimum possible value it should return.}}
{{param|number|max|The maximum possible value it should return.}}
=== Returns ===
{{param|number|number|The pseudo-random integer number.}}

== Examples ==
Generates a number between 1 and 100 (both inclusive).
<source lang="lua">
function love.load()
    randomNumber = love.math.random(1, 100)
end
</source>

== See Also ==
* [[parent::love.math]]
* [[love.math.setRandomSeed]]
* [[love.math.randomNormal]]
* [[love.math.newRandomGenerator]]
[[Category:Functions]]
{{#set:Description=Get uniformly distributed pseudo-random number}}

== Other Languages ==
{{i18n|love.math.random}}