| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected