OSDN Git Service
(root)
/
oi-wiki
/
main.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a65d956
)
Update bit.md
author
orzcyand1317
<36555123+orzcyand1317@users.noreply.github.com>
Mon, 4 Mar 2019 10:15:35 +0000
(18:15 +0800)
committer
GitHub
<noreply@github.com>
Mon, 4 Mar 2019 10:15:35 +0000
(18:15 +0800)
docs/math/bit.md
patch
|
blob
|
history
diff --git
a/docs/math/bit.md
b/docs/math/bit.md
index
44553df
..
c79a58f
100644
(file)
--- a/
docs/math/bit.md
+++ b/
docs/math/bit.md
@@
-204,7
+204,7
@@
void swap(int &a, int &b) {
```cpp
bool isFactorialofTwo(int n) {
return n > 0 ? (n & (n - 1)) == 0 : false;
- // 当然你也可以
写成下面这种形式
:
+ // 当然你也可以
使用下面这种更为简便的写法
:
// return n > 0 && (n & (n - 1)) == 0;
/* 如果是 2 的幂,n 一定是 100... n-1 就是 1111....
所以做与运算结果为 0 */