Boost.Random subtract_with_carry doesn't like m == numeric_limits<result_type>::digits
Hello, Boost folks.
I found a bug in subtract_with_carry_engine while fixing a bug in MSVC++'s implementation of the same, where m == numeric_limits
AMDG On 05/10/2016 01:43 PM, Billy O'Neal (VC LIBS) wrote:
MSVC++ said: 0xFCF0A4776BA0A6A8 Libstdc++ says: 0x01316AEA3646F686 Libc++ says: 0x01316AEA3646F686 Boost 1.60.0/libc++ + Clang says: 0x69E18848FE1BD36D Boost 1.60.0/libstdc++ + g++ says: 0x1DD6C263C41EEED0
MSVC++'s bug was that we did the underflow check incorrectly resulting in the carry bit always being set if m == numeric_limits
::digits. I fixed that and MSVC++ will agree with libstdc++ and libc++ in the next update; but boost's behavior here is still strange.
The first problem is this: BOOST_STATIC_CONSTANT(result_type, modulus = (result_type(1) << w)); which is almost certainly the cause of the different results for clang vs. g++. In Christ, Steven Watanabe
participants (2)
-
Billy O'Neal (VC LIBS)
-
Steven Watanabe