File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
lib/node_modules/@stdlib/math/base/special/tribonacci Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 2222
2323var isnan = require ( '@stdlib/math/base/assert/is-nan' ) ;
2424var isInteger = require ( '@stdlib/math/base/assert/is-integer' ) ;
25+ var FLOAT64_MAX_SAFE_NTH_TRIBONACCI = require ( '@stdlib/constants/float64/max-safe-nth-tribonacci' ) ; // eslint-disable-line id-length
2526var TRIBONACCI = require ( './tribonacci.json' ) ;
2627
2728
28- // VARIABLES //
29-
30- var MAX_TRIBONACCI = 63 ;
31-
32-
3329// MAIN //
3430
3531/**
@@ -83,7 +79,7 @@ function tribonacci( n ) {
8379 isnan ( n ) ||
8480 isInteger ( n ) === false ||
8581 n < 0 ||
86- n > MAX_TRIBONACCI
82+ n > FLOAT64_MAX_SAFE_NTH_TRIBONACCI
8783 ) {
8884 return NaN ;
8985 }
Original file line number Diff line number Diff line change 3636 "libraries" : [],
3737 "libpath" : [],
3838 "dependencies" : [
39- " @stdlib/math/base/napi/unary"
39+ " @stdlib/math/base/napi/unary" ,
40+ " @stdlib/constants/float64/max-safe-nth-tribonacci"
4041 ]
4142 },
4243 {
4950 ],
5051 "libraries" : [],
5152 "libpath" : [],
52- "dependencies" : []
53+ "dependencies" : [
54+ " @stdlib/constants/float64/max-safe-nth-tribonacci"
55+ ]
5356 },
5457 {
5558 "task" : " examples" ,
6164 ],
6265 "libraries" : [],
6366 "libpath" : [],
64- "dependencies" : []
67+ "dependencies" : [
68+ " @stdlib/constants/float64/max-safe-nth-tribonacci"
69+ ]
6570 }
6671 ]
6772}
Original file line number Diff line number Diff line change 1717*/
1818
1919#include "stdlib/math/base/special/tribonacci.h"
20+ #include "stdlib/constants/float64/max_safe_nth_tribonacci.h"
2021
21- static const int32_t STDLIB_CONSTANTS_FLOAT64_MAX_SAFE_NTH_TRIBONACCI = 63 ; // TODO: consider making a package similar to `@stdlib/constants/float64/max-safe-nth-fibonacci`
2222static const int64_t tribonacci_value [ 64 ] = {
2323 0 ,
2424 0 ,
@@ -96,7 +96,7 @@ static const int64_t tribonacci_value[ 64 ] = {
9696* // returns 0
9797*/
9898double stdlib_base_tribonacci ( const int32_t n ) {
99- if ( n < 0 || n > STDLIB_CONSTANTS_FLOAT64_MAX_SAFE_NTH_TRIBONACCI ) {
99+ if ( n < 0 || n > STDLIB_CONSTANT_FLOAT64_MAX_SAFE_NTH_TRIBONACCI ) {
100100 return 0.0 / 0.0 ; // NaN
101101 }
102102 return tribonacci_value [ n ];
You can’t perform that action at this time.
0 commit comments