MATH_Rand*

Syntax

#include <nitro/math/rand.h>

static inline u16 MATH_Rand16( MATHRandContext16 *context, u16 max );
static inline u32 MATH_Rand32( MATHRandContext32 *context, u32 max );

Arguments

context Pointer to the context of the random number
max Sets a maximum value for the random number being gotten. With this setting, the largest random number will be max - 1. If 0 is set here, the entire range of numbers can be gotten.

Return Values

A 16-bit random value for the MATH_Rand16 function and a 32-bit random value for the MATH_Rand32 function.

Description

This function gets a random number generated using the linear congruential method.

This is an inline function, so you can optimize the code and reduce waste by setting a constant in the max argument.

See Also

MATHRandContext*, MATH_InitRand*

Revision History

2004/12/13 Initial version.


CONFIDENTIAL