We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33df079 commit f4f1d53Copy full SHA for f4f1d53
Maths/Fibonacci.js
@@ -146,7 +146,7 @@ const matrixExpo = (A, n) => {
146
const TWO = isBigInt ? 2n : 2
147
148
// Just like Binary exponentiation mentioned in ./BinaryExponentiationIterative.js
149
- let result = Identity(A.length) // Identity matrix
+ let result = Identity((isBigInt ? BigInt : Number)(A.length)) // Identity matrix
150
while (n > ZERO) {
151
if (n % TWO !== ZERO) result = matrixMultiply(result, A)
152
n /= TWO
0 commit comments