Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
rand.cpp File Reference
#include "precompiled.h"
#include "lib/rand.h"
Include dependency graph for rand.cpp:

Functions

static size_t xrand ()
 
size_t rand (size_t min_inclusive, size_t max_exclusive)
 return random integer in [min, max). More...
 

Variables

static const size_t XRAND_MAX = (RAND_MAX+1)*(RAND_MAX+1) - 1
 

Function Documentation

◆ rand()

size_t rand ( size_t  min_inclusive,
size_t  max_exclusive 
)

return random integer in [min, max).

avoids several common pitfalls; see discussion at http://www.azillionmonkeys.com/qed/random.html

◆ xrand()

static size_t xrand ( )
static

Variable Documentation

◆ XRAND_MAX

const size_t XRAND_MAX = (RAND_MAX+1)*(RAND_MAX+1) - 1
static