@@ -92,7 +92,7 @@ const Identity = (size, bigint) => {
92
92
const matrixMultiply = ( A , B ) => {
93
93
A = copyMatrix ( A )
94
94
B = copyMatrix ( B )
95
- const isBigInt = typeof A [ 0 ] [ 0 ] === " bigint"
95
+ const isBigInt = typeof A [ 0 ] [ 0 ] === ' bigint'
96
96
const l = A . length
97
97
const m = B . length
98
98
const n = B [ 0 ] . length // Assuming non-empty matrices
@@ -116,7 +116,7 @@ const matrixMultiply = (A, B) => {
116
116
// A is a square matrix
117
117
const matrixExpo = ( A , n ) => {
118
118
A = copyMatrix ( A )
119
- const isBigInt = typeof n === " bigint"
119
+ const isBigInt = typeof n === ' bigint'
120
120
const ZERO = isBigInt ? 0n : 0
121
121
const TWO = isBigInt ? 2n : 2
122
122
@@ -146,10 +146,10 @@ const FibonacciMatrixExpo = (n) => {
146
146
147
147
if ( n === 0 || n === 0n ) return n
148
148
149
- let sign = n < 0
149
+ const sign = n < 0
150
150
if ( sign ) n = - n
151
151
152
- const isBigInt = typeof n === " bigint"
152
+ const isBigInt = typeof n === ' bigint'
153
153
const ZERO = isBigInt ? 0n : 0
154
154
const ONE = isBigInt ? 1n : 1
155
155
@@ -165,7 +165,7 @@ const FibonacciMatrixExpo = (n) => {
165
165
]
166
166
F = matrixMultiply ( poweredA , F )
167
167
// https://en.wikipedia.org/wiki/Generalizations_of_Fibonacci_numbers#Extension_to_negative_integers
168
- return F [ 0 ] [ 0 ] * ( sign ? ( - ONE ) ** ( n + ONE ) : ONE )
168
+ return F [ 0 ] [ 0 ] * ( sign ? ( - ONE ) ** ( n + ONE ) : ONE )
169
169
}
170
170
171
171
export { FibonacciDpWithoutRecursion }
0 commit comments