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 57ce8f0 commit 9ea2995Copy full SHA for 9ea2995
src/lib/math/is-power-of-two/is-power-of-two.ts
@@ -5,5 +5,5 @@
5
* @returns {boolean}
6
*/
7
export function isPowerOfTwo(value: number): boolean {
8
- return (value & (value - 1)) === 0;
+ return value && !(value & (value - 1));
9
}
0 commit comments