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:
5227433
)
Update fenwick.md
author
Lin Weijun
<37108698+Joke-Lin@users.noreply.github.com>
Wed, 13 May 2020 08:48:09 +0000
(16:48 +0800)
committer
GitHub
<noreply@github.com>
Wed, 13 May 2020 08:48:09 +0000
(16:48 +0800)
修改错误
针对88/-88补码计算的错误
docs/ds/fenwick.md
patch
|
blob
|
history
diff --git
a/docs/ds/fenwick.md
b/docs/ds/fenwick.md
index
3511d13
..
98ef081
100644
(file)
--- a/
docs/ds/fenwick.md
+++ b/
docs/ds/fenwick.md
@@
-62,8
+62,8
@@
int lowbit(int x) {
> $-x$ 代表 $x$ 的负数,计算机中负数使用对应的正数的补码来表示。
例如 :
- $x =88_{(10)}=1011000_{(2)}$ ;
- $-x = -88_{(10)} = (
0100111_{(2)} + 1_{(2)}) =
101000_{(2)}$ ;
+ $x =88_{(10)}=
0
1011000_{(2)}$ ;
+ $-x = -88_{(10)} = (
10100111_{(2)} + 1_{(2)}) =10
101000_{(2)}$ ;
$x\ \& \ (-x) = 1000_{(2)} = 8_{(10)}$ 。
神奇吧,我也觉得神奇!