Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add math/base/special/fibonaccif #6309

Closed

Conversation

Neerajpathak07
Copy link
Contributor

Progresses #649.

Description

What is the purpose of this pull request?

This pull request:

  • adds math/base/special/fibonaccif

Related Issues

Does this pull request have any related issues?

This pull request:

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.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Mar 22, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Mar 22, 2025

Coverage Report

Package Statements Branches Functions Lines
math/base/special/fibonaccif $\color{green}224/224$
$\color{green}+100.00\%$
$\color{green}10/10$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}224/224$
$\color{green}+100.00\%$

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

var arr;
var i;

arr = new Int32Array( n+1 );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

have created a new Int32Array for added clarity.

```

<!-- <div class="equation" align="center" data-raw-text="0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, \ldots" data-equation="eq:fibonacci_sequence">
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/fibonacci/docs/img/equation_fibonacci_sequence.svg" alt="Fibonacci sequence">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have referenced the svg to the double-precision itself as the fibonacci number:- 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 is also used for single-precision and the formula which should also stay the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or creating a new svg for single-precision version would be plausible??

@Neerajpathak07 Neerajpathak07 marked this pull request as ready for review March 22, 2025 21:17
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 22, 2025
If `n > 36`, the function returns `NaN`, as larger [Fibonacci numbers][fibonacci-number] cannot be safely represented in [single-precision floating-point format][ieee754].

```javascript
var v = fibonaccif( 37 );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

kept it close to the safe_integer limit for more clarity.

@gunjjoshi
Copy link
Member

@Neerajpathak07 We already seem to have a PR for this (#6257).

@gunjjoshi gunjjoshi added the Potential Duplicate There might be another pull request resolving the same issue. label Mar 23, 2025
@Neerajpathak07
Copy link
Contributor Author

ahh my bad I didn't look out for any existing PR's.
Alright I'll close this one.

@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Mar 23, 2025
@kgryte kgryte added Duplicate This issue or pull request already exists. and removed Potential Duplicate There might be another pull request resolving the same issue. labels Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate This issue or pull request already exists. Math Issue or pull request specific to math functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants