Opened 9 years ago
Last modified 9 years ago
#9361 new Bugs
boost::random::xor_combine max() has wrong
Reported by: | Owned by: | No-Maintainer | |
---|---|---|---|
Milestone: | To Be Determined | Component: | random |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
In haeder <boost/random/xor_combine.hpp> line139:
static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return (std::max)((URNG1::min)(), (URNG2::max)()); }
URNG1::min has wrong, maybe correctly is URNG1::max.
correct as below:
static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return (std::max)((URNG1::max)(), (URNG2::max)()); }
Note:
See TracTickets
for help on using tickets.
Actually both are wrong in the general case. min and max both need to take shift into account.