MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / randint

Function randint

source/utils/Random.cpp:55–58  ·  view source on GitHub ↗

\brief random integer [lo;hi]

Source from the content-addressed store, hash-verified

53
54//! \brief random integer [lo;hi]
55static int randint(int lo, int hi)
56{
57 return static_cast<int>(uniform() * (hi - lo + 1) + lo);
58}
59
60//! \brief random unsigned integer [lo;hi]
61static unsigned int randuint(unsigned int lo, unsigned int hi)

Callers 1

IntFunction · 0.85

Calls 1

uniformFunction · 0.85

Tested by

no test coverage detected