test: migrate math/base/special/binet to ULP-based testing #11719
Open
MANDEep22332 wants to merge 3 commits intostdlib-js:developfrom
Open
test: migrate math/base/special/binet to ULP-based testing #11719MANDEep22332 wants to merge 3 commits intostdlib-js:developfrom
math/base/special/binet to ULP-based testing #11719MANDEep22332 wants to merge 3 commits intostdlib-js:developfrom
Conversation
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
math/base/special/binet to ULP-based testing
kgryte
reviewed
Apr 23, 2026
| @@ -69,18 +66,14 @@ tape( 'for nonnegative integers, the function approximates the nth Fibonacci num | |||
| if ( v === expected ) { | |||
Member
There was a problem hiding this comment.
You no longer need this if condition. You only need the isAlmostSameValue check.
kgryte
reviewed
Apr 23, 2026
| delta = abs( v - expected ); | ||
| tol = 13.0 * EPS * abs( expected ); | ||
| t.strictEqual( delta <= tol, true, 'returns approximation. n: '+i+'. expected: '+expected+'. actual: '+v+'. Δ: '+delta+'. tol: '+tol+'.' ); | ||
| t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); |
Member
There was a problem hiding this comment.
Suggested change
| t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); | |
| t.strictEqual( isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); |
Spacing.
kgryte
reviewed
Apr 23, 2026
| delta = abs( v - expected ); | ||
| tol = 12.0 * EPS * abs( expected ); | ||
| t.strictEqual( delta <= tol, true, 'returns approximation. n: '+i+'. expected: '+expected+'. actual: '+v+'. Δ: '+delta+'. tol: '+tol+'.' ); | ||
| t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); |
Member
There was a problem hiding this comment.
Suggested change
| t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); | |
| t.strictEqual( isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' ); |
kgryte
reviewed
Apr 23, 2026
| @@ -89,9 +82,7 @@ tape( 'for nonpositive integers, the function approximates the nth negaFibonacci | |||
| if ( v === expected ) { | |||
Contributor
Author
|
@kgryte pls, review the changes in the file |
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.
Progresses #11352 .
Description
This pull request:
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
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers