Opened 20 years ago
Closed 18 years ago
#134 closed Bugs (Fixed)
uniform_int should receive specific type
Reported by: | nobody | Owned by: | jmaurer |
---|---|---|---|
Milestone: | Component: | random | |
Version: | None | Severity: | |
Keywords: | Cc: |
Description
In random_number_generator, a call is made to uniform_int<base_type>(_rng, 0, n-1)(). Inside the uniform_int constructor, a test is performed for assert(min < max). If the IntType specified for random_number_generator is unsigned long (one of the ones from mersenne_twister, for example), and a full range random number is being requested, then this assert will always fail, since the unsigned long max() will (normally) turn into int(-1). The fix is to ensure that the IntType specified in the instantiation of random_number_generator is propagated to uniform_int. phil <boost@derived-software.ltd.uk>
Note:
See TracTickets
for help on using tickets.