From 0a4ab190cd0861d4b71f27e6bf30545c1e0500a4 Mon Sep 17 00:00:00 2001 From: Jared Hoberock Date: Fri, 15 Feb 2019 17:50:40 -0600 Subject: [PATCH] Correct typo in bitwise AND operands --- random/include/boost/random/threefry4x64.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/random/include/boost/random/threefry4x64.hpp b/random/include/boost/random/threefry4x64.hpp index 6606945..11ac9f5 100644 --- a/random/include/boost/random/threefry4x64.hpp +++ b/random/include/boost/random/threefry4x64.hpp @@ -66,7 +66,7 @@ namespace detail { inline static UIntType zth(const boost::uint_least64_t (&_output)[4]) { return _output[0] & 0xFFFF; } inline static UIntType nth(const boost::uint_least64_t (&_output)[4], std::size_t n) - { return (_output[n>>2] >> ((n&11)<<4)) & 0xFFFF; } + { return (_output[n>>2] >> ((n&3)<<4)) & 0xFFFF; } inline static UIntType w_max() { return 0xFFFF; } }; @@ -75,7 +75,7 @@ namespace detail { inline static UIntType zth(const boost::uint_least64_t (&_output)[4]) { return _output[0] & 0xFF; } inline static UIntType nth(const boost::uint_least64_t (&_output)[4], std::size_t n) - { return (_output[n>>3] >> ((n&111)<<3)) & 0xFF; } + { return (_output[n>>3] >> ((n&7)<<3)) & 0xFF; } inline static UIntType w_max() { return 0xFF; } };