File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
lib/node_modules/@stdlib/math/base/special/tribonaccif Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 3838 "dependencies" : [
3939 " @stdlib/math/base/napi/unary" ,
4040 " @stdlib/constants/float32/max-safe-nth-tribonacci" ,
41- " @stdlib/math/base/assert/is-nanf"
41+ " @stdlib/math/base/assert/is-nanf" ,
42+ " @stdlib/math/base/assert/is-integerf"
4243 ]
4344 },
4445 {
5354 "libpath" : [],
5455 "dependencies" : [
5556 " @stdlib/constants/float32/max-safe-nth-tribonacci" ,
56- " @stdlib/math/base/assert/is-nanf"
57+ " @stdlib/math/base/assert/is-nanf" ,
58+ " @stdlib/math/base/assert/is-integerf"
5759 ]
5860 },
5961 {
6870 "libpath" : [],
6971 "dependencies" : [
7072 " @stdlib/constants/float32/max-safe-nth-tribonacci" ,
71- " @stdlib/math/base/assert/is-nanf"
73+ " @stdlib/math/base/assert/is-nanf" ,
74+ " @stdlib/math/base/assert/is-integerf"
7275 ]
7376 }
7477 ]
Original file line number Diff line number Diff line change 1919#include "stdlib/math/base/special/tribonaccif.h"
2020#include "stdlib/constants/float32/max_safe_nth_tribonacci.h"
2121#include "stdlib/math/base/assert/is_nanf.h"
22+ #include "stdlib/math/base/assert/is_integerf.h"
2223
2324static const int32_t tribonaccif_value [ 31 ] = {
2425 0 ,
@@ -65,10 +66,12 @@ static const int32_t tribonaccif_value[ 31 ] = {
6566* // returns 0
6667*/
6768float stdlib_base_tribonaccif ( const int32_t n ) {
68- if ( n < 0 || n > STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_TRIBONACCI || n == 3.14 ) { // eslint-disable-line max-len
69- return 0.0 / 0.0 ; // NaN
70- }
71- if ( stdlib_base_is_nanf ( n ) ){
69+ if (
70+ stdlib_base_is_nanf ( n ) ||
71+ stdlib_base_is_integerf ( n ) == false ||
72+ n < 0 ||
73+ n > STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_TRIBONACCI
74+ ) {
7275 return 0.0 / 0.0 ; // NaN
7376 }
7477 return tribonaccif_value [ n ];
You can’t perform that action at this time.
0 commit comments