Re: [Boost-bugs] [Boost C++ Libraries] #6059: uniform_real_distribution fails when _min = _max

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6059: uniform_real_distribution fails when _min = _max
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-04 19:22:44

#6059: uniform_real_distribution fails when _min = _max
  Reporter: dario.izzo@… | Owner: steven_watanabe
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: random
   Version: Boost 1.47.0 | Severity: Problem
Resolution: fixed | Keywords:

Comment (by digigram@…):

 this is a regression from 1.47 where min=max was allowed and returned the
 expected value. The regression breaks existing software. The logical
 return would simply be the max or min value when there is no range and so
 the proposed >= should be right.

 More fundamental, if the numerator<=divisor and both are greater than 0
 than result should always be between min and max (including max) and the
 for loop really does not make any sense unless max is not allowed to be
 part of the range, but I would not know why it shouldn't be. In matter of
 fact, I would say max should be part of the range simply because the max
 of a dice is 6 and the min is 1 and six can be thrown.

 So I propose to remove the for loop altogether, and the if assertion as

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC