I changed it to cstdlib.
How can I fix this problem?
Printable View
Quick and dirty:
However, if the random numbers will be as random (uniformly distributed) as the results you would get from the original drand48() function, I don't know.Code:double drand48() // random number between [0.0, 1.0]
{
return rand() / (double)RAND_MAX;
}
...
srand(time(0)); // somewhere in main()