Random library

A library for generating random numbers.

File:
Random.lib
Version:
1.0
Author:
Marcus Johansson

Contents

Details
Sub routines


Details

NaaLaa's built in 'rnd' function uses the standard C random number generator, which has a pretty limited range. This library has functions for generating random numbers with better range. It can also generate floating point values. The generator uses the multiply-with-carry method, invented by George Marsaglia.


Subroutines

Name
Parameters
Brief description
procedure
Randomize
seed
Set seed.
function
RandomInt
range
Get random integer.
function
RandomFloat#
range#
Get random float value.


Subroutine documentation

procedure Randomize ( seed )

Set the seeed value to use.

Parameter
Mode
Description
seed
In
Seed value.

[ Back ]


function RandomInt ( range )

Returns a random integer value in the range [0..range - 1].

Parameter
Mode
Description
range
In
The range.

Return value
A random integer value.

[ Back ]


function RandomFloat# ( range# )

Returns a random float value in the range [0..range[.

Parameter
Mode
Description
range
In
The range.

Return value
A random float value.

[ Back ]


Generated with NLDoc 20140630.