Skip to content

test: migrate math/base/special/binet to ULP-based testing #11719

Open
MANDEep22332 wants to merge 3 commits intostdlib-js:developfrom
MANDEep22332:test-binet
Open

test: migrate math/base/special/binet to ULP-based testing #11719
MANDEep22332 wants to merge 3 commits intostdlib-js:developfrom
MANDEep22332:test-binet

Conversation

@MANDEep22332
Copy link
Copy Markdown
Contributor

Progresses #11352 .

Description

What is the purpose of this pull request?

This pull request:

  • remove the old testing method

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.

No.

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.".

{{TODO: add disclosure if applicable}}


@stdlib-js/reviewers

@MANDEep22332 MANDEep22332 requested a review from a team April 22, 2026 11:07
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Apr 22, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Apr 22, 2026

Coverage Report

Package Statements Branches Functions Lines
math/base/special/binet $\color{green}250/250$
$\color{green}+0.00%$
$\color{green}9/9$
$\color{green}+0.00%$
$\color{green}2/2$
$\color{green}+0.00%$
$\color{green}250/250$
$\color{green}+0.00%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Tests Pull requests specifically adding tests. review: 5 and removed Needs Review A pull request which needs code review. labels Apr 23, 2026
@kgryte kgryte changed the title test: migrate math/base/special/binet to ULP-based testing test: migrate math/base/special/binet to ULP-based testing Apr 23, 2026
@@ -69,18 +66,14 @@ tape( 'for nonnegative integers, the function approximates the nth Fibonacci num
if ( v === expected ) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You no longer need this if condition. You only need the isAlmostSameValue check.

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' );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' );

Spacing.

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' );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.strictEqual(isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( v, expected, 24 ), true, 'returns expected value' );

@@ -89,9 +82,7 @@ tape( 'for nonpositive integers, the function approximates the nth negaFibonacci
if ( v === expected ) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment.

Copy link
Copy Markdown
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left initial comments.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. review: 2 and removed review: 5 labels Apr 23, 2026
@MANDEep22332
Copy link
Copy Markdown
Contributor Author

@kgryte pls, review the changes in the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. Needs Changes Pull request which needs changes before being merged. review: 2 Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants