Possible Duplicate:
How do you generate a random double uniformly distributed between 0 and 1 from C++?
I'm trying to figure out how to generate a random number between 0 and pi, but the usual method won't work because mod does integer division:
double num = rand() % 2*M_PI;
How would I go about doing this?
Thanks.