Forgot to add lower bound in RNG generation.
This commit is contained in:
parent
a15eb6f29f
commit
424513eb90
1 changed files with 1 additions and 1 deletions
|
@ -18,5 +18,5 @@ unsigned int RNG_SFMT::getNumber(unsigned int min, unsigned int max)
|
|||
mutex.unlock();
|
||||
|
||||
// return a random number from the interval [min, max]
|
||||
return (unsigned int) (r % (max - min + 1));
|
||||
return (unsigned int) (r % (max - min + 1) + min);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue