refactor: remove unneeded isnan checks#11693
Merged
Conversation
… conventions Dropped the redundant `isnan(N)||isnan(K)||isnan(n)` guard block at the top of `mean()`; `!isNonNegativeInteger()` already rejects NaN, matching the 7-guard validation prologue used by `kurtosis`, `mode`, `skewness`, and `variance` (80% of hypergeometric moment-computing siblings with explicit validation). Also removed the now-unused `@stdlib/math/base/assert/is-nan` require. Behavior is preserved — NaN inputs still return NaN.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
stats/base/dists/hypergeometric/mean with namespace conventionsisnan checks
kgryte
approved these changes
Apr 22, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This pull request
isnan(N)||isnan(K)||isnan(n)guard and the associated@stdlib/math/base/assert/is-nanrequire fromstats/base/dists/hypergeometric/mean. All other packages in the distribution namespace rely solely on the!isNonNegativeIntegerpredicate to reject NaN inputs —!isNonNegativeInteger(NaN)istrue.Related Issues
No.
Questions
No.
Other
Output of a cross-package drift-detection routine over a randomly selected stdlib namespace (
stats/base/dists/hypergeometric, seed1776774012099). See the local drift report for the full per-feature tally, excluded findings, and agent verdicts. Draft PR: a maintainer should audit before promoting to ready-for-review.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Claude Code executed a cross-package drift-detection routine that randomly selected the
stats/base/dists/hypergeometricnamespace (seed1776774012099), extracted structural and semantic features across the 11 sibling packages, computed majority patterns, and identified outliers. Three validation agents (opus × 2, sonnet × 1) independently verified each drift candidate; only findings classified asconfirmed-driftby all relevant agents were applied as mechanical, behavior-preserving patches. A maintainer must audit before promoting from draft.@stdlib-js/reviewers