Professional Documents
Culture Documents
Untitled
Untitled
std::rand() may return rather small values, 0..32767 is the minimum range, and does
so on some popular 32-bit platforms (MSVC among them). With time_t in seconds this
only gives you about eight hours of random noise.
Try combining the results from a pair of std::rand calls instead. E.g.
(std::time_t) std::rand() * RAND_MAX + std::rand() or switch to a better random
number generator.