Boost logo

Boost-Commit :

From: marshall_at_[hidden]
Date: 2008-04-29 16:16:19


Author: marshall
Date: 2008-04-29 16:16:19 EDT (Tue, 29 Apr 2008)
New Revision: 44897
URL: http://svn.boost.org/trac/boost/changeset/44897

Log:
Updated bounds on uniform_real and uniform_smallint to allow min == max
Text files modified:
   trunk/boost/random/uniform_real.hpp | 2 +-
   trunk/boost/random/uniform_smallint.hpp | 4 ++--
   2 files changed, 3 insertions(+), 3 deletions(-)

Modified: trunk/boost/random/uniform_real.hpp
==============================================================================
--- trunk/boost/random/uniform_real.hpp (original)
+++ trunk/boost/random/uniform_real.hpp 2008-04-29 16:16:19 EDT (Tue, 29 Apr 2008)
@@ -40,7 +40,7 @@
 #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
     BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
 #endif
- assert(min_arg < max_arg);
+ assert(min_arg <= max_arg);
   }
 
   // compiler-generated copy ctor and assignment operator are fine

Modified: trunk/boost/random/uniform_smallint.hpp
==============================================================================
--- trunk/boost/random/uniform_smallint.hpp (original)
+++ trunk/boost/random/uniform_smallint.hpp 2008-04-29 16:16:19 EDT (Tue, 29 Apr 2008)
@@ -81,7 +81,7 @@
 {
   _min = min_arg;
   _max = max_arg;
- assert(min_arg < max_arg);
+ assert(min_arg <= max_arg);
 
   _range = static_cast<base_result>(_max-_min)+1;
   _factor = 1;
@@ -122,7 +122,7 @@
     BOOST_STATIC_ASSERT(!std::numeric_limits<typename base_type::result_type>::is_integer);
 #endif
 
- assert(min_arg < max_arg);
+ assert(min_arg <= max_arg);
     set(min_arg, max_arg);
   }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk