real vale random number

I am facing problem to generate random number in real value. Let us consider l=0.045, so i need the random value between 0.0025 to 0.040. Can anybody help me how to write down programming code in c++ to determine real value generation of random number?
The appropriate function in C++ is std::uniform_real_distribution (assuming you want it uniformly distributed between 0.0025 and 0.040

http://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution
http://www.cplusplus.com/reference/random/uniform_real_distribution/
Last edited on
Topic archived. No new replies allowed.