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

Properly scale the random in SimpleRandomCollection #2220

Merged
merged 1 commit into from
May 12, 2023

Conversation

SirYwell
Copy link
Member

Overview

Fixes #2219

Description

SimpleRandomCollection always selected an entry in the range [0, 1). This is wrong however, as it has to scale to [0, total).
This problem likely wasn't discovered before because most uses of the random pattern make use of FastRandomCollection instead.

Submitter Checklist

  • Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • Ensure that the pull request title represents the desired changelog entry.
  • New public fields and methods are annotated with @since TODO.
  • I read and followed the contribution guidelines.

@SirYwell SirYwell requested a review from a team as a code owner May 12, 2023 07:52
@github-actions github-actions bot added the Bugfix This PR fixes a bug label May 12, 2023
@NotMyFault NotMyFault merged commit 71bac00 into main May 12, 2023
7 checks passed
@NotMyFault NotMyFault deleted the fix/SimpleRandomCollection branch May 12, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Random Pattern produces incorrect distribution
3 participants