This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
Section: 188.8.131.52.2 [rand.dist.uni.real] Status: C++17 Submitter: Marshall Clow Opened: 2012-07-14 Last modified: 2017-07-30
View all issues with C++17 status.
uniform_real says in 184.108.40.206.2 [rand.dist.uni.real] p1:
A uniform_real_distribution random number distribution produces random numbers x, a ≤ x < b,
but also that (220.127.116.11.2 [rand.dist.uni.real] p2):
explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0);
-2- Requires: a ≤ b and b - a ≤ numeric_limits<RealType>::max().
If you construct a uniform_real_distribution<RealType>(a, b) where there are no representable numbers between 'a' and 'b' (using RealType's representation) then you cannot satisfy 18.104.22.168.2 [rand.dist.uni.real].An obvious example is when a == b.
Jonathan provides wording.
Moved to Ready with the note.
There remains concern that the constructors are permitting values that may (or may not) be strictly outside the domain of the function, but that is a concern that affects the design of the random number facility as a whole, and should be addressed by a paper reviewing and addressing the whole clause, not picked up in the issues list one distribution at a time. It is still not clear that such a paper would be uncontroversial.
This wording is relative to N4140.
Add a note after paragraph 1 before the synopsis in 22.214.171.124.2 [rand.dist.uni.real]:
-1- A uniform_real_distribution random number distribution produces random numbers , , distributed according to the constant probability density function
Drafting note: should be in math font, and a == b should be in code font.