Skip to content

fix: support full 64-bit integer range for number inputs in int64/ctor - #15477

Merged
kgryte merged 7 commits into
stdlib-js:developfrom
impawstarlight:fix/int64-ctor
Sep 24, 2026
Merged

kgryte merged 7 commits into
stdlib-js:developfrom
impawstarlight:fix/int64-ctor

Conversation

@impawstarlight

Copy link
Copy Markdown
Member

Resolves none.

Description

What is the purpose of this pull request?

This pull request:

  • Lifts the restriction on number arguments to the Int64 constructor to allow unsafe integers of magnitude upto 2^64-1.

Related Issues

Does this pull request have any related issues?

No.

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

N/A.


@stdlib-js/reviewers

@impawstarlight
impawstarlight requested a review from a team September 23, 2026 22:08
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 23, 2026
@impawstarlight impawstarlight added the Enhancement Issue or pull request for enhancing existing functionality. label Sep 23, 2026
@impawstarlight

Copy link
Copy Markdown
Member Author

Depends on #15475

@kgryte kgryte removed the Needs Review A pull request which needs code review. label Sep 24, 2026
var MIN_SAFE_INTEGER = require( '@stdlib/constants/float64/min-safe-integer' );
var format = require( '@stdlib/string/format' );
var ToPrimitiveSymbol = require( '@stdlib/symbol/to-primitive' );
var bigint2words = require( '@stdlib/number/uint64/base/bigint2words' ).assign;

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.

@impawstarlight Should we go ahead and add int64/base/bigint2words?

@stdlib-bot

stdlib-bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
number/int64/ctor $\\color{red}594/676$
$\\color{green}+0.00\\%$
$\\color{red}48/52$
$\\color{green}+0.00\\%$
$\\color{red}9/11$
$\\color{green}+0.00\\%$
$\\color{red}594/676$
$\\color{green}+0.00\\%$

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

Comment thread lib/node_modules/@stdlib/number/int64/ctor/lib/main.js Outdated
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/number/int64/ctor/test/test.js Outdated
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/number/int64/ctor/test/test.to_string.js Outdated
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>

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

LGTM

@kgryte
kgryte merged commit ed84323 into stdlib-js:develop Sep 24, 2026
12 checks passed
@impawstarlight
impawstarlight deleted the fix/int64-ctor branch September 24, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Issue or pull request for enhancing existing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants