I have an event that should have a 0.5% probability of occurring (not very often).
How can I generate a random number based on this probability?
Would something like this be sufficient, I don't believe so as srand returns an integer...
double rate = 0.05;
if((srand() % 100) < rate)
{
std::cout << "Event Occurred" << endl;
}