-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
var arr; | ||
var i; | ||
|
||
arr = new Int32Array( n+1 ); |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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??
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 ); |
There was a problem hiding this comment.
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.
@Neerajpathak07 We already seem to have a PR for this (#6257). |
ahh my bad I didn't look out for any existing PR's. |
Progresses #649.
Description
This pull request:
math/base/special/fibonaccif
Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers