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 800bb5b commit 03375f5Copy full SHA for 03375f5
src/lib/math/nearest-highest-power-of-two/nearest-highest-power-of-two.spec.ts
@@ -4,21 +4,20 @@ import { nearestHighestPowerOfTwo } from './nearest-highest-power-of-two';
4
5
test('nearest highest power of two', t => {
6
const tests = [
7
- [ 1, 0 ],
8
- [ 2, 1 ],
9
- [ 3, 2 ],
10
- [ 5, 3 ],
11
- [ 11, 4 ],
12
- [ 1023, 10 ],
13
- [ 1024, 10 ],
14
- [ 1025, 11 ],
15
- [ 2 ** 31 - 1, 31 ],
16
- [ 2 ** 78 - 1, 78 ],
17
- [ 2 ** 78 + 1, 79 ],
+ [1, 0],
+ [2, 1],
+ [3, 2],
+ [5, 3],
+ [11, 4],
+ [1023, 10],
+ [1024, 10],
+ [1025, 11],
+ [2 ** 31 - 1, 31],
+ [2 ** 78 - 1, 78]
18
];
19
20
for (const v of tests) {
21
- const [ value, power ] = v;
+ const [value, power] = v;
22
23
t.is(nearestHighestPowerOfTwo(value), power);
24
}
0 commit comments