Skip to content

test: migrate constants/float16/ln-two-pi to ULP-based assertions - #16185

Draft
kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-constants-float16-ln-two-pi
Draft

kgryte wants to merge 1 commit into
developfrom
kgryte/ulp-constants-float16-ln-two-pi

Conversation

@kgryte

@kgryte kgryte commented Oct 16, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates the tests for constants/float16/ln-two-pi from relative tolerance assertions to ULP-based assertions, replacing the delta/tol computation with @stdlib/number/float16/base/assert/is-almost-same-value.
  • wraps the computed value in @stdlib/number/float64/base/to-float16 before comparison, mirroring the already migrated constants/float16/ln-half and constants/float16/pi-squared packages.
  • uses a ULP bound of 0, which is the measured minimum. float64ToFloat16( lnf( 2.0*PI ) ) and the exported constant are bit-for-bit identical (1.837890625), so no slack is required. The suite was run twice at 0 to confirm determinism.

Only test/test.js is changed.

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.

Verification performed locally:

  • make test TESTS_FILTER=".*/constants/float16/ln-two-pi/.*" → 4 passing (run twice, identical results).
  • make eslint-tests TESTS_FILTER=".*/constants/float16/ln-two-pi/.*" → clean.

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.

This PR was authored by Claude Code, which studied the previously merged migrations in this family, applied the same idiom, and measured the minimum passing ULP bound.


@stdlib-js/reviewers


Generated by Claude Code

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

Copy link
Copy Markdown
Contributor

Hello! 👋

We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm!

Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks.

Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀

For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers!

@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
constants/float16/ln-two-pi $\\color{green}55/55$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}0/0$
$\\color{green}+100.00\\%$
$\\color{green}55/55$
$\\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