|
Boost : |
Subject: Re: [boost] [random] new threefry random engine
From: Thijs (M.A.) van den Berg (thijs_at_[hidden])
Date: 2014-04-20 12:25:36
On Apr 20, 2014, at 5:18 PM, Mathias Gaunard <mathias.gaunard_at_[hidden]> wrote:
> On 18/04/14 10:00, Thijs van den Berg wrote:
>
>>>
>>> Do not use reinterpret_cast in operator().
>>> The behavior is undefined, and will certainly
>>> differ depending on endianness.
>> I did this for speed and I didnât worry about endianness because it never crossed my mind. Changing the order of bits/bytes should not affect the quality of the randomness, but itâs indeed not nice to have different behaviour on different machines. Iâll fix this.
>
> Personally I would want this engine to produce exactly the same results as the reference random123 implementation for a given seed.
>
> This should be the case regardless of the platform used.
>
I totally agree, I want that too.
Ive removed the reinterpret_cast, but it would be nice if we could very its behavior, eg on a platform that has different endianness.
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk