Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74168 - in trunk: boost/random libs/random/test
From: steven_at_[hidden]
Date: 2011-08-30 15:31:43


Author: steven_watanabe
Date: 2011-08-30 15:31:43 EDT (Tue, 30 Aug 2011)
New Revision: 74168
URL: http://svn.boost.org/trac/boost/changeset/74168

Log:
geometric_distribution::min should be 0. Fixes #5704.
Text files modified:
   trunk/boost/random/geometric_distribution.hpp | 2 +-
   trunk/libs/random/test/test_geometric_distribution.cpp | 4 ++--
   2 files changed, 3 insertions(+), 3 deletions(-)

Modified: trunk/boost/random/geometric_distribution.hpp
==============================================================================
--- trunk/boost/random/geometric_distribution.hpp (original)
+++ trunk/boost/random/geometric_distribution.hpp 2011-08-30 15:31:43 EDT (Tue, 30 Aug 2011)
@@ -124,7 +124,7 @@
     RealType p() const { return _p; }
 
     /** Returns the smallest value that the distribution can produce. */
- IntType min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return IntType(1); }
+ IntType min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return IntType(0); }
 
     /** Returns the largest value that the distribution can produce. */
     IntType max BOOST_PREVENT_MACRO_SUBSTITUTION () const

Modified: trunk/libs/random/test/test_geometric_distribution.cpp
==============================================================================
--- trunk/libs/random/test/test_geometric_distribution.cpp (original)
+++ trunk/libs/random/test/test_geometric_distribution.cpp 2011-08-30 15:31:43 EDT (Tue, 30 Aug 2011)
@@ -16,9 +16,9 @@
 #define BOOST_RANDOM_ARG1_DEFAULT 0.5
 #define BOOST_RANDOM_ARG1_VALUE 0.25
 
-#define BOOST_RANDOM_DIST0_MIN 1
+#define BOOST_RANDOM_DIST0_MIN 0
 #define BOOST_RANDOM_DIST0_MAX (std::numeric_limits<int>::max)()
-#define BOOST_RANDOM_DIST1_MIN 1
+#define BOOST_RANDOM_DIST1_MIN 0
 #define BOOST_RANDOM_DIST1_MAX (std::numeric_limits<int>::max)()
 
 #define BOOST_RANDOM_TEST1_PARAMS (0.9999)


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