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

Question regarding match statement in uniform.rs -> Sample single value, Canon's method, unbiased. #1433

Closed
Thell opened this issue Apr 8, 2024 · 1 comment

Comments

@Thell
Copy link

Thell commented Apr 8, 2024

In sample_single_inclusive with feature unbiased:

If checked_add performs addition that returns None instead of wrapping around on overflow then won't it always return either a value or None? If so, when would the default case ever happen? And, if it never happens then shouldn't it be removed? And, if it should be removed then isn't it then the same as the sample_single_value without the unbiased feature (Canon's method, biased)?

@Thell
Copy link
Author

Thell commented Apr 8, 2024

Never mind, I was totally forgetting the conditional part of the Some(x) match. Sorry.

@Thell Thell closed this as completed Apr 8, 2024
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

No branches or pull requests

1 participant