Repository navigation
test: migrate math/base/special/roundb to ULP-based assertions - #14538
Merged
Merged
Conversation
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/roundbfrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.Specifically, in both
test/test.jsandtest/test.native.js, thedelta/tolcomputation in the "the function supports rounding very small numbers (including subnormals)" test is replaced with a singleisAlmostSameValueassertion, the now-unused@stdlib/constants/float64/epsand@stdlib/math/base/special/absrequires are removed, and@stdlib/assert/is-almost-same-valueis added.Final ULP constants:
test/test.js1test/test.native.js1Both values are the measured minimum. Over the full set of 17 fixture cases, the maximum observed ULP difference is
1for both the JavaScript and C implementations (5 of the 17 cases differ by exactly 1 ULP; the remaining 12 are bit-for-bit exact). Lowering the bound to0fails, so1is the tightest bound which passes.The suite was run twice at the final ULP value, with the native add-on built locally so that
test/test.native.jsactually executes rather than being skipped. Both runs were green and identical (test.js: 668/668;test.native.js: 658/658), confirming no FMA/architecture-related non-determinism.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
The conversion mirrors the idiom established in
math/base/special/croundn(#14327), which has a structurally identical subnormal rounding test.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 unattended scheduled task: it selected the package, studied prior conversions in the repository to match the established idiom, applied the edits, and measured the minimum ULP bound by running the test suite.
@stdlib-js/reviewers
Generated by Claude Code