# MATH_Rand*

## C Specification

      #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

None.

## 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

12/13/2004 Initial version.

CONFIDENTIAL