Closed brghena closed 3 years ago
Hmmm. This is probably because I changed it, but I don’t know which it’s doing now…
Experiment confirms that the range is inclusive. This prints both 1s and 2s:
ge211::Random_source<int> src(1, 2);
for (int i = 0; i < 10; ++i) {
std::cout << src() << "\n";
}
I’ll fix the docs. Thanks!
I think the constructor
Random_source(result_type min, result_type max)
constructs a random source that generates values betweenmin
andmax
exclusive.Alternatively, the example code may be wrong, as it calls
(1,7)
to get a six-sided die.https://tov.github.io/ge211/classge211_1_1_random__source.html#a3c7be16a8b2f45f8980949d5eb5476d1