Subject: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero with single precision float
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-30 10:23:40
#9966: exponential_distribution returns negative zero with single precision float
------------------------------+---------------------------
Reporter: mazzamuto@⦠| Owner: no-maintainer
Type: Bugs | Status: new
Milestone: To Be Determined | Component: random
Version: Boost 1.55.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------
The code below produces this output:
1.72296[[BR]]
-0[[BR]]
0.295209[[BR]]
0.210905[[BR]]
0.930678[[BR]]
{{{
#!c++
#include <fstream>
#include <boost/random.hpp>
using namespace boost::random;
using namespace std;
int main() {
ifstream mtfile;
mtfile.open("mt.dat"); //see attached file
mt19937 mt;
mtfile >> mt;
mtfile.close();
for (int i = 0; i < 5; ++i) {
cout << exponential_distribution<float>(1.f)(mt) << endl;
}
return 0;
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9966> 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:16 UTC