Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/ccutil/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ inline const std::vector<std::string> split(const std::string &s, char c) {
return v;
}

// A simple linear congruential random number generator.
// A simple linear congruential random number generator,
// using Knuth's constants from:
// http://en.wikipedia.org/wiki/Linear_congruential_generator.
class TRand {
public:
// Sets the seed to the given value.
Expand All @@ -95,7 +97,10 @@ class TRand {
}

private:
std::minstd_rand e;
std::linear_congruential_engine<std::uint_fast32_t,
6364136223846793005ULL,
1442695040888963407ULL,
UINT64_MAX> e;
};

// Remove newline (if any) at the end of the string.
Expand Down
Loading