 Function: IRandom Function: IRandom # IRandom (NUMBER )

Returns a random positive integer up to (but not including) the provided value.

### Parameters

Parameter Type Description
NUMBER VALUE(INTEGER) The upper bound integer.

### Returns

 VALUE(INTEGER) A random positive integer.

### What It Does

This function returns a random integer from 0 up to (but not including) the provided value. The input value, if it is not an integer, is interpreted as an integer.

### Example

NOTE: The following code will return different values every time it is executed!

### Random Function Examples

``````
world
{
start()
{
local a;
a = 10;
textln("Generating " + a + " integers from 0 to 9:");
while (a > 0)
{
textln(irandom(10));
a = a - 1;
}
textln("");

a = 10;
textln("Generating " + a + " floats from [0.0, 1.0):");
while (a > 0)
{
textln(frandom());
a = a - 1;
}
textln("");

a = 10;
textln("Generating " + a + " Gaussian floats, mean 0, std. dev. 1:");
while (a > 0)
{
textln(grandom(0, 1));
a = a - 1;
}

quit;
}
}
``````