Skip to content

Commit a83f40f

Browse files
committed
style: improve code formatting for consistency in MobiusFunction.js and PollardsRho.js
1 parent da71276 commit a83f40f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Maths/MobiusFunction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ export const mobiusFunction = (number) => {
2828
return primeFactorsArray.length !== new Set(primeFactorsArray).size
2929
? 0
3030
: primeFactorsArray.length % 2 === 0
31-
? 1
32-
: -1
31+
? 1
32+
: -1
3333
}

Maths/PollardsRho.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
function gcd(a, b) {
99
while (b !== 0) {
10-
[a, b] = [b, a % b]
10+
;[a, b] = [b, a % b]
1111
}
1212
return a
1313
}
@@ -19,7 +19,10 @@ function gcd(a, b) {
1919
*/
2020
export function pollardsRho(n) {
2121
if (n % 2 === 0) return 2
22-
let x = 2, y = 2, d = 1, f = v => (v * v + 1) % n
22+
let x = 2,
23+
y = 2,
24+
d = 1,
25+
f = (v) => (v * v + 1) % n
2326
while (d === 1) {
2427
x = f(x)
2528
y = f(f(y))

0 commit comments

Comments
 (0)