MCPcopy Create free account
hub / github.com/DFHack/dfhack / random

Function random

library/include/modules/Random.h:59–62  ·  view source on GitHub ↗

[0, 2^32)

Source from the content-addressed store, hash-verified

57
58 // [0, 2^32)
59 uint32_t random() {
60 if (mt_index >= MT_LEN) twist();
61 return mt_buffer[mt_index++];
62 }
63 // [0, limit)
64 uint32_t random(uint32_t limit) {
65 return uint32_t(uint64_t(random())*limit >> 32);

Callers 6

df_trandomMethod · 0.85
df_loadtrandomMethod · 0.85
drandom0Function · 0.85
drandomFunction · 0.85
drandom1Function · 0.85
permuteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected