Skip to content

feat: add C implementation for @stdlib/stats/base/dists/pareto-type1/median#10691

Open
rautelaKamal wants to merge 1 commit intostdlib-js:developfrom
rautelaKamal:feat/pareto-type1-median-c
Open

feat: add C implementation for @stdlib/stats/base/dists/pareto-type1/median#10691
rautelaKamal wants to merge 1 commit intostdlib-js:developfrom
rautelaKamal:feat/pareto-type1-median-c

Conversation

@rautelaKamal
Copy link
Contributor

Ref: #3861.

Description

This PR adds a double-precision C implementation for @stdlib/stats/base/dists/pareto-type1/median, following the pattern established by the arcsine CDF implementation (PR #3354).

Changes

  • Add C header file (include/stdlib/stats/base/dists/pareto-type1/median.h)
  • Implement stdlib_base_dists_pareto_type1_median in C for double-precision
  • Create Node-API addon bridge using STDLIB_MATH_BASE_NAPI_MODULE_DD_D macro
  • Add GYP build configuration (binding.gyp, include.gypi, manifest.json)
  • Create lib/native.js dispatcher for JavaScript integration
  • Update package.json to enable gypfile
  • Add comprehensive native test suite (test/test.native.js) with tryRequire pattern
  • Add JavaScript native benchmark (benchmark/benchmark.native.js)
  • Add C benchmark (benchmark/c/benchmark.c)
  • Add C example (examples/c/example.c)
  • Update README with C API documentation

Testing

  • Native test suite mirrors existing test/test.js with all edge cases
  • Uses standard tryRequire/skip pattern for graceful degradation

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. labels Mar 3, 2026
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/pareto-type1/median $\color{green}190/190$
$\color{green}+100.00%$
$\color{green}8/8$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}190/190$
$\color{green}+100.00%$

The above coverage report was generated for the changes in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants