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: fix incorrect example in Uniform #1204

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

xu-cheng
Copy link
Contributor

The current example to implement SampleUniform for custom types is incorrect. It mistakenly forwards the implementation of UniformSampler::new_inclusive to UniformSampler::new.

The current example to implement `SampleUniform` for custom types is incorrect.
It mistakenly forwards the implementation of `UniformSampler::new_inclusive` to
`UniformSampler::new`.
@vks
Copy link
Collaborator

vks commented Nov 24, 2021

Thanks, this makes sense. The difference between new and new_inclusive is very small for floats, but there is a difference.

@vks vks merged commit 1a880aa into rust-random:master Dec 6, 2021
@xu-cheng xu-cheng deleted the uniform-example branch December 6, 2021 16:05
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.

2 participants