Math.random

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
BlackNecro (Talk)
(New page: {{LuaFunction |function_name = math.random |arguments = [ number m [, number n]] |returns = number Number |description = This function i...)

Latest revision as of 00:58, 15 February 2009

Function
Syntaxmath.random( [ number m [, number n]] )
Description:
This function is an interface to the simple pseudo-random generator function rand provided by ANSI C. (No guarantees can be given for its statistical properties.) When called without arguments, returns a uniform pseudo-random real number in the range [0,1). When called with an integer number m, math.random returns a uniform pseudo-random integer in the range [1, m]. When called with two integer numbers m and n, math.random returns a uniform pseudo-random integer in the range [m, n].
Returnsnumber Number




Example
DescriptionPlaceholder!
Code
  1. for k,v in pairs(PagesWithoutExamples) do
  2.     v.MakeExample(NoErrors);
  3. end
OutputPlaceholder!