File tree 3 files changed +12
-11
lines changed
lib/node_modules/@stdlib/math/base/special/tribonacci
3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 22
22
23
23
var isnan = require ( '@stdlib/math/base/assert/is-nan' ) ;
24
24
var 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
25
26
var TRIBONACCI = require ( './tribonacci.json' ) ;
26
27
27
28
28
- // VARIABLES //
29
-
30
- var MAX_TRIBONACCI = 63 ;
31
-
32
-
33
29
// MAIN //
34
30
35
31
/**
@@ -83,7 +79,7 @@ function tribonacci( n ) {
83
79
isnan ( n ) ||
84
80
isInteger ( n ) === false ||
85
81
n < 0 ||
86
- n > MAX_TRIBONACCI
82
+ n > FLOAT64_MAX_SAFE_NTH_TRIBONACCI
87
83
) {
88
84
return NaN ;
89
85
}
Original file line number Diff line number Diff line change 36
36
"libraries" : [],
37
37
"libpath" : [],
38
38
"dependencies" : [
39
- " @stdlib/math/base/napi/unary"
39
+ " @stdlib/math/base/napi/unary" ,
40
+ " @stdlib/constants/float64/max-safe-nth-tribonacci"
40
41
]
41
42
},
42
43
{
49
50
],
50
51
"libraries" : [],
51
52
"libpath" : [],
52
- "dependencies" : []
53
+ "dependencies" : [
54
+ " @stdlib/constants/float64/max-safe-nth-tribonacci"
55
+ ]
53
56
},
54
57
{
55
58
"task" : " examples" ,
61
64
],
62
65
"libraries" : [],
63
66
"libpath" : [],
64
- "dependencies" : []
67
+ "dependencies" : [
68
+ " @stdlib/constants/float64/max-safe-nth-tribonacci"
69
+ ]
65
70
}
66
71
]
67
72
}
Original file line number Diff line number Diff line change 17
17
*/
18
18
19
19
#include "stdlib/math/base/special/tribonacci.h"
20
+ #include "stdlib/constants/float64/max_safe_nth_tribonacci.h"
20
21
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`
22
22
static const int64_t tribonacci_value [ 64 ] = {
23
23
0 ,
24
24
0 ,
@@ -96,7 +96,7 @@ static const int64_t tribonacci_value[ 64 ] = {
96
96
* // returns 0
97
97
*/
98
98
double 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 ) {
100
100
return 0.0 / 0.0 ; // NaN
101
101
}
102
102
return tribonacci_value [ n ];
You can’t perform that action at this time.
0 commit comments