|
// Get floating-point random numbers between 0-1
DOUBLE GetRand0 ()
{
srand (timeGetTime ());
DOUBLE d = (DOUBLE) GetRand (0,1000) /1000.0;
return d;
}
// Get integer random number
// Parameter: minN The minimum number to generate a random number
// maxN: maximum number of random numbers
INT GetRand (INT minN, INT maxN)
{
srand (timeGetTime ());
INT r = minN + rand ()% (maxN + 1);
return r;
} |
|