Answers for "random float range value in cpp"

C++
-1

c++ random float

float get_random()
{
    static std::default_random_engine e;
    static std::uniform_real_distribution<> dis(0, 1); // rage 0 - 1
    return dis(e);
}
Posted by: Guest on April-20-2021

Code answers related to "random float range value in cpp"

Browse Popular Code Answers by Language