Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rand.dist.uni.real] Correct a typo #2369

Closed
wants to merge 1 commit into from

Conversation

majnemer
Copy link

The uniform_­real_­distribution produces numbers such that a ≤ x < b.
However, the requirement in [rand.dist.uni.real]p2 as written would permit a and b to be equal.

The uniform_­real_­distribution produces numbers such that a ≤ x < b.
However, the requirement in [rand.dist.uni.real]p2 as written would permit a and b to be equal.
@timsong-cpp
Copy link
Contributor

This is intentional and not a typo. See https://wg21.link/lwg2168 and https://wg21.link/N3926.

@tkoeppe
Copy link
Contributor

tkoeppe commented Oct 23, 2018

Indeed. There is even a note about a == b in http://eel.is/c++draft/numerics#rand.dist.uni.real-1, which would not make sense if a == b wasn't even allowed. It is allowed, but results in undefined behaviour.

@tkoeppe tkoeppe closed this Oct 23, 2018
@majnemer majnemer deleted the rand.dist.uni.real/p2 branch October 23, 2018 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants