mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-17 18:33:35 +02:00
rnd for random_shuffle
Origin commit data
------------------
Commit: b3491f2c20
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2016-03-28 (Mon, 28 Mar 2016)
This commit is contained in:
@@ -76,12 +76,11 @@ class RandomNumber
|
||||
public:
|
||||
RandomNumber()
|
||||
{
|
||||
srand(time(0));
|
||||
std::srand(time(0));
|
||||
}
|
||||
|
||||
int operator()(int n)
|
||||
{
|
||||
return (n * rand() / RAND_MAX);
|
||||
int operator()(int n){
|
||||
return std::rand() / (1.0 + RAND_MAX) * n;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user