RAND

RAND [Macro]

Function

RAND

Creates a pseudo-random number with an upper limit

Syntax

#include <ultra64.h>        /* gu.h */
RAND(s32 max)

Arguments

max
Upper limit to the random number generated (1 ~ 1073741824)

Returned value

32-bit integer (0 ~ max-1)

Description

Returns a pseudo-random number within the range (0 ~ max-1). If there is no need to set an upper limit on the random number, you can also use guRandom.

See Also

guRandom

Revision History

03/01/99 Completely rewritten.