Skip to content

Commit b1d28c5

Browse files
authored
Update SingleBitOperators.java
1 parent 3e0d113 commit b1d28c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public static int setBit(int num, int bit) {
2121
* Clears the bit located at 'bit' from 'num'
2222
*/
2323
public static int clearBit(int num, int bit) {
24-
return num & ~(1 << clear);
24+
return num & ~(1 << bit);
2525
}
2626
/**
2727
* Get the bit located at 'bit' from 'num'
2828
*/
2929
public static int getBit(int num, int bit) {
30-
return ((num >> get) & 1);
30+
return ((num >> bit) & 1);
3131
}
3232
}

0 commit comments

Comments
 (0)