mirror of
https://github.com/apple/pkl.git
synced 2026-07-11 15:42:48 +02:00
logical and fix in mathUtils (#102)
This commit is contained in:
@@ -63,7 +63,7 @@ public final strictfp class MathUtils {
|
|||||||
* Long.bitCount(Long.MIN_VALUE) == 1}, but {@link Long#MIN_VALUE} is not a power of two.
|
* Long.bitCount(Long.MIN_VALUE) == 1}, but {@link Long#MIN_VALUE} is not a power of two.
|
||||||
*/
|
*/
|
||||||
public static boolean isPowerOfTwo(long x) {
|
public static boolean isPowerOfTwo(long x) {
|
||||||
return x > 0 & (x & (x - 1)) == 0;
|
return x > 0 && (x & (x - 1)) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user