MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Tools_RandomLCG

Function Tools_RandomLCG

src/tools.c:278–283  ·  view source on GitHub ↗

* Get a random value from the LCG. */

Source from the content-addressed store, hash-verified

276 * Get a random value from the LCG.
277 */
278static int16 Tools_RandomLCG(void)
279{
280 /* Borland C/C++ 'a' and 'b' value, bits 30..16, as used by Dune2 */
281 s_randomLCG = 0x015A4E35 * s_randomLCG + 1;
282 return (s_randomLCG >> 16) & 0x7FFF;
283}
284
285/**
286 * Get a random value between the given values.

Callers 1

Tools_RandomLCG_RangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected