refactor calculatePossibleRangeSize to be more readable
Browse files- index.html +1 -1
index.html
CHANGED
@@ -132,7 +132,7 @@
|
|
132 |
const divisors = [];
|
133 |
for (let i = 1; i <= num; i++) {
|
134 |
const quotient = num / i;
|
135 |
-
if (
|
136 |
divisors.push(i);
|
137 |
}
|
138 |
}
|
|
|
132 |
const divisors = [];
|
133 |
for (let i = 1; i <= num; i++) {
|
134 |
const quotient = num / i;
|
135 |
+
if (Number.isInteger(quotient) || (quotient % 0.5 === 0 && !Number.isInteger(quotient))) {
|
136 |
divisors.push(i);
|
137 |
}
|
138 |
}
|