Skip to content

Commit ea39661

Browse files
authored
Fixed style
1 parent 398854c commit ea39661

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Maths/Fibonacci.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const Identity = (size, bigint) => {
9292
const matrixMultiply = (A, B) => {
9393
A = copyMatrix(A)
9494
B = copyMatrix(B)
95-
const isBigInt = typeof A[0][0] === "bigint"
95+
const isBigInt = typeof A[0][0] === 'bigint'
9696
const l = A.length
9797
const m = B.length
9898
const n = B[0].length // Assuming non-empty matrices
@@ -116,7 +116,7 @@ const matrixMultiply = (A, B) => {
116116
// A is a square matrix
117117
const matrixExpo = (A, n) => {
118118
A = copyMatrix(A)
119-
const isBigInt = typeof n === "bigint"
119+
const isBigInt = typeof n === 'bigint'
120120
const ZERO = isBigInt ? 0n : 0
121121
const TWO = isBigInt ? 2n : 2
122122

@@ -146,10 +146,10 @@ const FibonacciMatrixExpo = (n) => {
146146

147147
if (n === 0 || n === 0n) return n
148148

149-
let sign = n < 0
149+
const sign = n < 0
150150
if (sign) n = -n
151151

152-
const isBigInt = typeof n === "bigint"
152+
const isBigInt = typeof n === 'bigint'
153153
const ZERO = isBigInt ? 0n : 0
154154
const ONE = isBigInt ? 1n : 1
155155

@@ -165,7 +165,7 @@ const FibonacciMatrixExpo = (n) => {
165165
]
166166
F = matrixMultiply(poweredA, F)
167167
// 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)
169169
}
170170

171171
export { FibonacciDpWithoutRecursion }

0 commit comments

Comments
 (0)