-
-
Notifications
You must be signed in to change notification settings - Fork 815
feat: add math/base/special/tribonaccif
#6066
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
base: develop
Are you sure you want to change the base?
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
#include "stdlib/constants/float32/max_safe_nth_tribonacci.h" | ||
#include "stdlib/math/base/assert/is_nanf.h" | ||
|
||
static const int32_t tribonaccif_value[ 31 ] = { |
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.
went with 31 values here.
cc:- @kgryte @Planeshifter LMK what am I missing here!! |
@Planeshifter Hey could I pls know why the |
@Neerajpathak07 Simple, because you consistently use Because you consistently use |
@kgryte ahh I see alright then I shall update all the other PR's for this. |
2555757, | ||
4700770, | ||
8646064, | ||
15902591 |
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 taken values till here as the FLOAT32_MAX_SAFE_INTEGER
is 16777215 so any value beyond this just returns NaN
if ( n < 0 || n > STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_TRIBONACCI ) { | ||
return 0.0 / 0.0; // NaN | ||
} |
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.
Haven't added cases for is_nanf
and to check if n
is int. As while operating on int32_t
variables we don't want to return NaN
for integers and NaN
itself.
@kgryte Kindly review this and LMK if I am missing something!! |
* @example | ||
* var y = tribonaccif( 6 ); | ||
* // returns 7 | ||
* | ||
* @example | ||
* var y = tribonaccif( -1 ); | ||
* // returns NaN | ||
*/ |
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.
Also removed the example for testing tribonaccif
value for 3.14
integer. As it just truncates the value and return s 0 which is undesirable.
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
@Neerajpathak07 Looks like this PR is missing |
@gunjjoshi Let me get back to you with the updated changes!! |
Progresses #649.
Description
This pull request:
math/base/special/tribonaccif
which is the single-precision version oftribonacci
Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers