![]() |
Home | Libraries | People | FAQ | More |
boost::random::uniform_01
// In header: <boost/random/uniform_01.hpp> template<typename RealType = double> class uniform_01 { public: // types typedef RealType ; typedef RealType ; // public member functions result_type () ; result_type () ; void (); template<typename Engine> result_type (Engine &); };
The distribution function uniform_01 models a random distribution . On each invocation, it returns a random floating-point value uniformly distributed in the range [0..1).
The template parameter RealType shall denote a float-like value type with support for binary operators +, -, and /.
Note: The current implementation is buggy, because it may not fill all of the mantissa with random bits. I'm unsure how to fill a (to-be-invented) boost::bigfloat
class with random bits efficiently. It's probably time for a traits class.
uniform_01
public member functionsresult_type () ;
result_type () ;
void ();
template<typename Engine> result_type (Engine & eng);