test: migrate math/base/special/croundn to ULP-based assertions - #14327
Merged
Conversation
Replaces relative tolerance assertions in the `croundn` tests with `isAlmostSameValue` ULP difference assertions. The minimum ULP value which passes the full fixture set is 1 for both the JavaScript and native implementations. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TfarAoSHwhj3MftfXNKEnn
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves a part of #11352.
Description
This pull request:
math/base/special/croundnfrom relative tolerance testing to ULP difference testing.delta/tolrelative error comparison intest/test.jsandtest/test.native.jswithisAlmostSameValue( actual, expected[ i ], 1 )assertions, adding the@stdlib/assert/is-almost-same-valuerequire and dropping the now unused@stdlib/constants/float64/epsand@stdlib/math/base/special/absrequires.The affected test is
the function supports rounding very small numbers (including subnormals), which compares both the real and imaginary components against the expected fixture values.ULP constants used:
test/test.jstest/test.native.jsBoth values were tightened to the measured minimum: the maximum observed ULP difference over the full fixture set is 1 for the JavaScript implementation and 1 for the native implementation, and re-running the suite with a bound of 0 fails 10 assertions in each file. The suite was run twice at the final bound to confirm the results are deterministic (690 passing in
test/test.js, 684 passing intest/test.native.js, with the native add-on compiled locally so that the native tests actually execute rather than skip).Only the two test files are modified.
Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running as an automated task. The ULP bounds were measured empirically against the existing fixtures rather than guessed.
@stdlib-js/reviewers
Generated by Claude Code