MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / Random

Method Random

src/base/random.h:37–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36 public:
37 explicit Random(uint32_t s) : seed_(s & 0x7fffffffu) {
38 // Avoid bad seeds.
39 if (seed_ == 0 || seed_ == 2147483647L) {
40 seed_ = 1;
41 }
42 }
43 uint32_t Next() {
44 static const uint32_t M = 2147483647L; // 2^31-1
45 static const uint64_t A = 16807; // bits 14, 8, 7, 5, 2, 1, 0

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected