Skip to content

test: migrate constants/float64/ln-half to ULP-based assertions - #16181

Draft
kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-constants-float64-ln-half
Draft

kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-constants-float64-ln-half

Conversation

@kgryte

@kgryte kgryte commented Oct 15, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

The single converted assertion is

t.strictEqual( isAlmostSameValue( v, LN_HALF, 0 ), true, 'returns expected value' );

Final ULP bound: 0. This is the measured minimum. ln( 0.5 ) returns -0.6931471805599453, which is bit-for-bit equal to the exported constant (v === LN_HALF), so the measured ULP difference is zero (confirmed directly via @stdlib/number/float64/base/ulp-difference) and no slack is required. Tightening from a loose bound, every value down to 0 passes; 0 is the smallest permissible non-negative integer, so the bound cannot be tightened further. The suite was run twice at the final bound to confirm determinism.

Only the test file is changed:

lib/node_modules/@stdlib/constants/float64/ln-half/test/test.js | 15 +++-------------
1 file changed, 3 insertions(+), 12 deletions(-)

Verification:

  • make test TESTS_FILTER=".*/constants/float64/ln-half/.*" → 4/4 passing (run twice, identical results).
  • make lint-javascript-tests TESTS_FILTER=".*/constants/float64/ln-half/.*" → clean.

Note: lint-editorconfig-files could not run in this environment, as the editorconfig-checker wrapper fetches its binary from GitHub releases at runtime and outbound access to that endpoint is blocked. The changed lines were checked by hand for tab indentation, LF endings, absence of trailing whitespace, and a final newline.

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

This PR was authored by Claude Code running as an unattended scheduled task. It selected the package, mirrored the migration idiom from previously merged conversions in the same family, determined the minimum ULP bound empirically, and ran the package tests and test linter locally.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01LTJeDwCBeFHUHW644yyJKW


Generated by Claude Code

@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Oct 15, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
constants/float64/ln-half $\\color{green}51/51$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}0/0$
$\\color{green}+100.00\\%$
$\\color{green}51/51$
$\\color{green}+100.00\\%$

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

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

Good First PR A pull request resolving a Good First Issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants