Random Numbers
Random Numbers — Various functions returning random numbers
|
|
Description
The following functions provide an easy way to get random floating point
numbers. All functions using the internal rand()
function
to generate random numbers.
Functions
clampf ()
gfloat
clampf (gfloat num
,
gfloat min
,
gfloat max
);
Returns
min
if num
< min
, max
if num
> max
and num
in all other cases
rand1f ()
gfloat
rand1f (gfloat max
);
Returns
A random floating point number between 0 and max
rand2f ()
gfloat
rand2f (gfloat min
,
gfloat max
);
Returns
A random floating point number between min
and max
randf ()
gfloat
randf (void
);
Returns
A random floating point number between 0 and 1