Subject: [Boost-bugs] [Boost C++ Libraries] #6053: uniform_real goes into an infinite loop when lb=ub
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-24 19:03:01
#6053: uniform_real goes into an infinite loop when lb=ub
---------------------------------------+------------------------------------
Reporter: dario.izzo@⦠| Owner: no-maintainer
Type: Bugs | Status: new
Milestone: To Be Determined | Component: random
Version: Boost 1.47.0 | Severity: Problem
Keywords: |
---------------------------------------+------------------------------------
The following code, compiled on my mac (i686-apple-darwin9-g++-4.2.1) goes
into an infinite loop.
The problem is in boost::uniform_real<double>(90,90)(rng); as the lower
and upper bounds are the same
#include<boost/random/uniform_real.hpp>
#include<boost/random/lagged_fibonacci.hpp>
#include<iostream>
int main() {
boost::lagged_fibonacci607 rng(32);
double r = boost::uniform_real<double>(90,91)(rng);
std::cout << r << std::endl;
r = boost::uniform_real<double>(90,90)(rng);
return 0;
}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6053> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC