Repository navigation
Address PR feedback on Random.NextXx - #127849
Merged
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-numerics |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates System.Random’s new generic integer APIs (NextInteger<T>) to address post-merge feedback, primarily around documenting/enforcing assumptions for supported IBinaryInteger<T> implementations and simplifying the full-range generation path.
Changes:
- Updates
NextInteger<T>type requirements in XML docs (two’s-complement/full-range wording). - Adjusts
NextInteger<T>()to validateT.MaxValuesign and simplifies generation (removes rejection loop). - Refactors range generation logic (ternary simplification) and folds the generic rejection-sampling helper into
NextBinaryIntegerInRange.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Private.CoreLib/src/System/Random.cs | Tweaks docs/validation and refactors generic integer random generation logic for NextInteger<T> and helpers. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 3
tannergooding
approved these changes
May 6, 2026
stephentoub
temporarily deployed
to
copilot-pat-pool
July 13, 2026 01:15 — with
GitHub Actions
Inactive
Member
Author
|
@copilot please address all of the pending feedback |
stephentoub
temporarily deployed
to
copilot-pat-pool
July 13, 2026 01:15 — with
GitHub Actions
Inactive
stephentoub
had a problem deploying
to
copilot-pat-pool
July 13, 2026 01:16 — with
GitHub Actions
Failure
stephentoub
temporarily deployed
to
copilot-pat-pool
July 13, 2026 01:17 — with
GitHub Actions
Inactive
stephentoub
temporarily deployed
to
copilot-pat-pool
July 13, 2026 01:17 — with
GitHub Actions
Inactive
stephentoub
temporarily deployed
to
copilot-pat-pool
July 13, 2026 01:18 — with
GitHub Actions
Inactive
Co-authored-by: stephentoub <[email protected]>
Co-authored-by: stephentoub <[email protected]>
Contributor
Addressed in |
stephentoub
enabled auto-merge (squash)
July 13, 2026 01:52
stephentoub
disabled auto-merge
July 13, 2026 01:52
stephentoub
enabled auto-merge (squash)
July 13, 2026 01:52
tannergooding
approved these changes
Jul 14, 2026
This was referenced Jul 15, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Somehow the extra commit didn't get into the PR before it merged.
cc: @tannergooding