Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add C and js implementation for stats/strided/snancumin#10655

Open
Witty-31-06 wants to merge 2 commits intostdlib-js:developfrom
Witty-31-06:feature/snancumin
Open

feat: add C and js implementation for stats/strided/snancumin#10655
Witty-31-06 wants to merge 2 commits intostdlib-js:developfrom
Witty-31-06:feature/snancumin

Conversation

@Witty-31-06
Copy link
Contributor


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: passed
  • task: lint_package_json status: passed
  • task: lint_repl_help status: passed
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • 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: passed
  • task: lint_license_headers status: passed ---

Resolves #307

Description

What is the purpose of this pull request?

This pull request:

  • Adds JS implementation for stats/strided/snancumin
  • Adds native C implementation for stats/strided/dnancumin
  • Adds benchmark, docs and relevant tests.

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.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • [] Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

{{TODO: add disclosure if applicable}}


@stdlib-js/reviewers

---
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: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - 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: passed
  - task: lint_license_headers
    status: passed
---
@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 2, 2026
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Mar 2, 2026

Coverage Report

Package Statements Branches Functions Lines
stats/strided/snancumin $\color{green}407/407$
$\color{green}+100.00%$
$\color{green}27/27$
$\color{green}+100.00%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}407/407$
$\color{green}+100.00%$

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

* // returns <Float32Array>[ 1.0, -2.0, -2.0, -2.0, 0.0, 0.0, 0.0, 0.0 ]
*/
function snancumin( N, x, strideX, offsetX, y, strideY, offsetY ) {
var flag;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flag keep tracks if the function has seen a number besides NaN or not. it turns true when it encounters a number (not NaN ) for first time.

@Witty-31-06
Copy link
Contributor Author

/stdlib help

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Mar 2, 2026
@stdlib-bot
Copy link
Contributor

@Witty-31-06, available slash commands include:

  • /stdlib check-files - Check for required files.
  • /stdlib make-commands - Print make commands for package changed in PR.
  • /stdlib update-copyright-years - Update copyright header years.
  • /stdlib lint-autofix - Auto-fix lint errors.
  • /stdlib merge - Merge changes from develop branch into this PR.
  • /stdlib rebase - Rebase this PR on top of develop branch.

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Mar 2, 2026
@Witty-31-06
Copy link
Contributor Author

/stdlib lint-autofix

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Mar 2, 2026
@Witty-31-06
Copy link
Contributor Author

/stdlib check-files

@stdlib-bot
Copy link
Contributor

Hi @Witty-31-06, thank you for your contribution!

🎉 Your pull request contains all required files for the new package: 🎉

  • package.json
  • README.md
  • docs/repl.txt
  • docs/types/index.d.ts
  • docs/types/test.ts
  • lib/index.js
  • lib/main.js
  • benchmark/benchmark.js
  • examples/index.js
  • test/test.js

-- stdlib-bot

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Mar 2, 2026
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.

RFC: add stats/strided/snancumin

2 participants