Re: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-07 16:47:35


#9966: exponential_distribution returns negative zero
-------------------------------+---------------------------
  Reporter: mazzamuto@… | Owner: no-maintainer
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: random
   Version: Boost 1.48.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+---------------------------

Comment (by anonymous):

 The bug appears also with double precision floats. The code below produces
 this output:

 {{{
 2.298
 -0
 1.22475
 1.07758
 0.66385
 }}}

 {{{#!c++
 #include <fstream>
 #include <boost/random.hpp>

 using namespace boost::random;
 using namespace std;

 int main() {
     ifstream mtfile;
     mtfile.open("mt_double.dat"); //see attached file
     mt19937 mt;
     mtfile >> mt;
     mtfile.close();

     for (int i = 0; i < 5; ++i) {
         cout << exponential_distribution<double>(1.f)(mt) << endl;
     }

     return 0;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9966#comment:2>
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