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

Poisson returns -1 for small lambda #1284

Merged
merged 2 commits into from
Feb 13, 2023
Merged

Poisson returns -1 for small lambda #1284

merged 2 commits into from
Feb 13, 2023

Conversation

tearne
Copy link
Contributor

@tearne tearne commented Feb 10, 2023

Small lambda reveals the current implementation of Knuth's method fails, yielding an output of -1. It can be fixed with different starting values.

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, looks like the condition was tested too soon relative to Knuth's method (usually written do ... while condition).

@vks
Copy link
Collaborator

vks commented Feb 12, 2023

Thanks! Could you please also add a bullet point to the CHANGELOG.md?

@tearne
Copy link
Contributor Author

tearne commented Feb 12, 2023

Sure. Done. Force-pushed since I had initially branched off 0.4.3

@dhardy dhardy merged commit f2e21db into rust-random:master Feb 13, 2023
@tearne tearne deleted the poissonknuth branch February 13, 2023 09: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.

3 participants