We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0449c4b commit d0adbc3Copy full SHA for d0adbc3
src/main/java/com/thealgorithms/bitmanipulation/BitSwap.java
@@ -17,7 +17,7 @@ private BitSwap() {
17
* @return The modified value with swapped bits
18
* @throws IllegalArgumentException if either position is negative or ≥ 32
19
*/
20
-
+
21
public static int bitSwap(int data, final int posA, final int posB) {
22
if (posA < 0 || posA >= Integer.SIZE || posB < 0 || posB >= Integer.SIZE) {
23
throw new IllegalArgumentException("Bit positions must be between 0 and 31");
0 commit comments