...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::uniform_real
// In header: <boost/random/uniform_real.hpp> template<typename RealType = double> class uniform_real { public: // types typedef RealType input_type; typedef RealType result_type; // construct/copy/destruct uniform_real(RealType = RealType(0), RealType = RealType(1)); // public member functions result_type min() const; result_type max() const; void reset(); template<typename Engine> result_type operator()(Engine &); };
The distribution function uniform_real models a random distribution. On each invocation, it returns a random floating-point value uniformly distributed in the range [min..max). The value is computed using std::numeric_limits<RealType>::digits random binary digits, i.e. the mantissa of the floating-point value is completely filled with random bits.
Note: The current implementation is buggy, because it may not fill all of the mantissa with random bits.