Repository navigation
feat(stats): add C implementation for stats/base/dists/hypergeometric/cdf - #10341
Merged
Merged
Conversation
whizzel
force-pushed
the
hypergeometric-cdf
branch
from
February 18, 2026 10:53
9d5c6d3 to
e53e179
Compare
…/cdf
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: missing_dependencies
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: passed
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: missing_dependencies
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: passed
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
stats/base/dists/hypergeometric/cdf
Contributor
Author
|
@kgryte a quick review plz! |
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closed
- Fix manifest.json indentation to 2-space convention - Remove unused pinf dependency, add missing is-infinite dependency - Add trunc and is-infinite to benchmark/examples dependency lists - Add missing stdint.h include in example.c - Add blank line between license header and includes in main.c - Split combined variable declarations to one per line - Change benchmark parameter arrays from int32_t to double to match function signature Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Handle negative infinity in CDF (was UB: trunc(-Inf) cast to int32_t) - Add direct stdint.h include in main.c instead of relying on transitive include - Remove unnecessary stdint.h from cdf.h (signature is all-double) - Fix operator spacing in main.c and example.c to match stdlib convention - Change t.equal to t.strictEqual in test.native.js - Normalize assertion messages to 'returns expected value' in test.native.js Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Change N, K, n parameters from double to int32_t to match the sibling PMF function signature and DIII_D NAPI convention - Update addon.c macro from DDDD_D to DIII_D - Remove is-nonnegative-integer dependency (integer validation now uses direct comparisons on int32_t, matching PMF pattern) - Restore int32_t benchmark arrays (matching PMF benchmark) - Eliminates the double-to-int32_t casts that were in the function body Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
With int32_t parameters, the NAPI layer converts JS values before the C function receives them (NaN->0, 30.5->30, PINF->INT_MAX). Remove tests for NaN/fractional/infinite parameter values that can only be validated on the JS side. Keep negative integer tests which are still caught by the C validation. Matches the PMF test.native.js pattern. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Add C APIs section to README with usage, signature docs, and example - Add random_discrete helper in example.c using stdlib_base_round instead of raw int32_t casts, matching PMF convention - Add round dependency to examples task in manifest.json Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… native docblock - Add missing section.c wrapper, C APIs heading, horizontal rule, and intro section to README C API block (matching PMF structure) - Cast int32_t operands to double before multiplication in the CDF recurrence to prevent overflow with large population sizes - Trim native.js docblock to only show examples that work through the DIII_D NAPI layer (remove NaN/fractional/PINF parameter examples) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Replace random_discrete/stdlib_base_round pattern with random_int helper using rand()%range, matching sibling hypergeometric packages (mean, mode) - Update example.c, benchmark.c, and README C example consistently - Remove round dependency from benchmark and examples manifest tasks Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Planeshifter
approved these changes
Sep 2, 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.
Resolves #3659 .
Description
This pull request:
Related Issues
This pull request has the following related issues:
@stdlib/stats/base/dists/hypergeometric/cdf#3659Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers