This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/85439] mt19937_64 producing unexpected result only in certain configuration


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85439

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marc "Foddex" Oude Kotte from comment #4)
> Obviously I'm not testing the 10000th consecutive invocation but the 1st,

No, as Walter explained, you're not even doing that.

If you want to inspect the 1st output of the MT engines, or the 10000th, then
do that:

template<typename Generator, template<typename> class, typename Type>
Type generateRandom() {
  return Generator()();
}

If you do this you'll see that every implementation produces the same results
from the mersenne-twisters engines.

Your program inspects the output of std::uniform_input_distribution instead.
The standard says nothing about the exact values it produces, only the
distribution of values given a range of inputs. So as Walter suggested, I'm
closing this as INVALID, as there's no bug here.

(Also, stop using names like _Generator, _Dist and _Type, those are reserved
names, see http://en.cppreference.com/w/cpp/language/identifiers for details).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]