Skip to content

feat: add number/uint64/base/or - #16513

Open
impawstarlight wants to merge 2 commits into
stdlib-js:developfrom
impawstarlight:feature/uint64-base-or
Open

impawstarlight wants to merge 2 commits into
stdlib-js:developfrom
impawstarlight:feature/uint64-base-or

Conversation

@impawstarlight

@impawstarlight impawstarlight commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Resolves none.

Description

What is the purpose of this pull request?

This pull request:

  • Adds a package to compute the bitwise OR of two 64-bit unsigned integers.

Related Issues

Does this pull request have any related issues?

No.

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

  • number/uint64/base/xor

What carried over from the reference(s)?

  • Package structure.

What differed, or what did you have to work out yourself?

  • The assign function, tests, examples.

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.".

Used Antigravity for quick scaffolding from reference package.


@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_pkg_readmes
    status: passed
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - 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: 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: passed
  - task: lint_license_headers
    status: passed
---
@impawstarlight
impawstarlight requested a review from a team November 5, 2026 19:58
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Nov 5, 2026
@impawstarlight impawstarlight added the Feature Issue or pull request for adding a new feature. label Nov 5, 2026
@stdlib-bot

stdlib-bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
number/uint64/base/or $\\color{green}231/231$
$\\color{green}+0.00\\%$
$\\color{green}7/7$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{green}231/231$
$\\color{green}+0.00\\%$

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

a = values[ i ];
b = values[ (i+1)%values.length ];
out = or( a, b );
big64orsum = BigInt.asUintN( 64, a.valueOf() | b.valueOf() );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why orsum?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Because we are testing the or operation/package? Um, not sure what are asking here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, I guess the sum part of orsum seems weird? Would you prefer just big64or?

var i;
for ( i = 0; i < values.length; i++ ) {
v = or( values[ i ], mask );
console.log( '%s | %s = %s', toHex64( values[ i ] ), toHex64( mask ), toHex64( v ) );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment as examples file.

@impawstarlight impawstarlight Dec 4, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is there any reasoning behind the inlining of the calculation? I thought the separate variable would improve clarity since example files are to be read by a lot.

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left initial comments.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Dec 4, 2026
@impawstarlight
impawstarlight requested a review from kgryte December 4, 2026 21:26
@impawstarlight impawstarlight removed the Needs Changes Pull request which needs changes before being merged. label Dec 4, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 4, 2026

This branch has not been deployed

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

Labels

Feature Issue or pull request for adding a new feature. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants