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

Function randgen

source/utils/Random.cpp:33–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31const unsigned long MAX = 32768;
32
33static unsigned long randgen()
34{
35 myRandomSeed = myRandomSeed * 1103515245 + 12345;
36 //TODO: What is the purpose of the cast?
37 unsigned long returnVal = static_cast<unsigned int>(myRandomSeed / 65536) % MAX;
38
39 return returnVal;
40}
41
42//! \brief uniformly distributed number [0;1)
43static double uniform()

Callers 1

uniformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected