calculatepossiblerange: allow quotient that is a multiple of 0.5
Browse files- index.html +7 -9
index.html
CHANGED
@@ -128,17 +128,15 @@
|
|
128 |
}
|
129 |
});
|
130 |
|
131 |
-
function calculatePossibleRangeSize(
|
132 |
-
const
|
133 |
-
for (let
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
}
|
138 |
-
possibleRangeSizes.push(rangeSize);
|
139 |
}
|
140 |
}
|
141 |
-
return
|
142 |
}
|
143 |
|
144 |
function generateConfig(totalLayers, rangeSize, nbParameters, model, doWhatISay) {
|
|
|
128 |
}
|
129 |
});
|
130 |
|
131 |
+
function calculatePossibleRangeSize(num) {
|
132 |
+
const divisors = [];
|
133 |
+
for (let i = 1; i <= num; i++) {
|
134 |
+
const quotient = num / i;
|
135 |
+
if (num % i === 0 || (quotient % 0.5 === 0 && quotient !== Math.floor(quotient))) {
|
136 |
+
divisors.push(i);
|
|
|
|
|
137 |
}
|
138 |
}
|
139 |
+
return divisors.sort((a, b) => a - b);
|
140 |
}
|
141 |
|
142 |
function generateConfig(totalLayers, rangeSize, nbParameters, model, doWhatISay) {
|