Skip to content

Commit

Permalink
Fixing checkExactlyOneBitSet
Browse files Browse the repository at this point in the history
  • Loading branch information
teivah committed Feb 1, 2020
1 parent 57e7f0c commit fec8941
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bit.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Vector (linear sequence of numeric values stored contiguously in memory) in whic

```java
boolean checkExactlyOneBitSet(int num) {
return (num & (num - 1)) == 0;
return num != 0 && (num & (num - 1)) == 0;
}
```

Expand Down

0 comments on commit fec8941

Please sign in to comment.