I found this formula and thought it was a good one to use for getting a randomly generated number between 0 and 1. However, I need to compare the randomly generated number to other numbers. How do I store for use in if comparison statements.
double r() {
    random_device rd;
    mt19937 gen(rd());
    uniform_real_distribution<> dis(0, 1);
    cout << "dis gen is " << dis(gen) << endl;
//    cout << '\n';
    return 0;
}
 
    