mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
rnd for random_shuffle
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