Skip to content

Commit fbd314e

Browse files
author
liwentian
committed
fd
1 parent 80d054a commit fbd314e

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎doc/BitSet.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
- 判断奇偶`x&1`
1+
- Check if the integer is even or odd
2+
```
3+
if ((x & 1) == 0) {
4+
x is even
5+
} else {
6+
x is odd
7+
}
8+
```
9+
- 测试nth bit是否设置:`x & (1 << n)`
10+
- 设置nth bit:`x | (1 << n)`
11+
-

0 commit comments

Comments
 (0)