Skip to content

test: migrate math/base/special/atandf to ULP-based assertions - #14699

Merged
kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-giuu23
Aug 27, 2026
Merged

kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-giuu23

Conversation

@kgryte

@kgryte kgryte commented Aug 27, 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 test suite for math/base/special/atandf from relative tolerance testing (delta <= EPS * absf( expected )) to ULP difference testing via @stdlib/number/float32/base/assert/is-almost-same-value.
  • updates both test/test.js and test/test.native.js, removing the absf and @stdlib/constants/float32/eps imports along with the delta/tol bookkeeping, and replacing the t.ok( delta <= tol, ... ) assertions with t.strictEqual( isAlmostSameValuef( y, e, 1 ), true, 'returns expected value' );.

The ULP bound was tightened to the measured minimum:

File Fixture set ULP
test/test.js julia/negative.json (2003 values) 1
test/test.js julia/positive.json (2003 values) 1
test/test.native.js julia/negative.json (2003 values) 1
test/test.native.js julia/positive.json (2003 values) 1

1 is the minimum: at 0 ULP, 970 of the 2003 values in each fixture set fail (for both the JavaScript and the C implementation), and at 1 ULP none fail.

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.

  • Only the two test files are modified; no source, fixtures, or documentation were touched.
  • make test TESTS_FILTER=".*/math/base/special/atandf/.*" passes: 4009/4009 assertions for test/test.js and 4009/4009 for test/test.native.js. The native add-on was built locally (make install-node-addons NODE_ADDONS_PATTERN="atandf") so that test/test.native.js was actually exercised rather than skipped, and the suite was run twice at the final ULP value to confirm determinism.
  • ESLint is clean against etc/eslint/.eslintrc.tests.js.

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, following the migration pattern established in previously merged conversions (e.g., math/base/special/logitf), with the ULP bound measured empirically against the full fixture set.


@stdlib-js/reviewers


Generated by Claude Code

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 27, 2026
@kgryte
kgryte marked this pull request as ready for review August 27, 2026 06:34
@kgryte
kgryte requested a review from a team August 27, 2026 06:34
@kgryte
kgryte merged commit 02bc116 into develop Aug 27, 2026
34 checks passed
@kgryte
kgryte deleted the claude/great-brahmagupta-giuu23 branch August 27, 2026 06:35
@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Aug 27, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

No coverage information available.

@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Aug 27, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Sep 5, 2026
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. Math Issue or pull request specific to math functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants