Skip to content

Commit 44308e7

Browse files
committed
Fix
1 parent 06f9eca commit 44308e7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/com/thealgorithms/bitmanipulation/HigherLowerPowerOfTwo.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ private HigherLowerPowerOfTwo() {
2727
* @return The next higher power of two.
2828
*/
2929
public static int nextHigherPowerOfTwo(int x) {
30-
if (x < 1) return 1;
30+
if (x < 1) {
31+
return 1;
32+
}
3133
x--;
3234
x |= x >> 1;
3335
x |= x >> 2;
@@ -44,7 +46,9 @@ public static int nextHigherPowerOfTwo(int x) {
4446
* @return The next lower power of two.
4547
*/
4648
public static int nextLowerPowerOfTwo(int x) {
47-
if (x < 1) return 0;
49+
if (x < 1) {
50+
return 0;
51+
}
4852
return Integer.highestOneBit(x);
4953
}
5054
}

0 commit comments

Comments
 (0)