# HG changeset patch # User Alpar Juttner # Date 2008-11-11 11:12:37 # Node ID c4aa9f097ef103efaace0da886a07331ba7c8ddf # Parent 6dbd5184c6a99e936a7de899e64c114e30c0f94f Bugfix in Random (#173) - operator()s always return a double now - the faulty real(Num) and real(Num,Num) have been removed diff --git a/lemon/random.h b/lemon/random.h --- a/lemon/random.h +++ b/lemon/random.h @@ -692,22 +692,6 @@ return real(); } - /// \brief Returns a random real number the range [0, b) - /// - /// It returns a random real number from the range [0, b). - template - Number real(Number b) { - return real() * b; - } - - /// \brief Returns a random real number from the range [a, b) - /// - /// It returns a random real number from the range [a, b). - template - Number real(Number a, Number b) { - return real() * (b - a) + a; - } - /// @} ///\name Uniform distributions @@ -724,17 +708,15 @@ /// \brief Returns a random real number from the range [0, b) /// /// It returns a random real number from the range [0, b). - template - Number operator()(Number b) { - return real() * b; + double operator()(double b) { + return real() * b; } /// \brief Returns a random real number from the range [a, b) /// /// It returns a random real number from the range [a, b). - template - Number operator()(Number a, Number b) { - return real() * (b - a) + a; + double operator()(double a, double b) { + return real() * (b - a) + a; } /// \brief Returns a random integer from a range