mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
rnd for random_shuffle
This commit is contained in:
@@ -76,12 +76,11 @@ class RandomNumber
|
|||||||
public:
|
public:
|
||||||
RandomNumber()
|
RandomNumber()
|
||||||
{
|
{
|
||||||
srand(time(0));
|
std::srand(time(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
int operator()(int n)
|
int operator()(int n){
|
||||||
{
|
return std::rand() / (1.0 + RAND_MAX) * n;
|
||||||
return (n * rand() / RAND_MAX);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user