OSDN Git Service

Update fenwick.md
authorLin Weijun <37108698+Joke-Lin@users.noreply.github.com>
Wed, 13 May 2020 08:48:09 +0000 (16:48 +0800)
committerGitHub <noreply@github.com>
Wed, 13 May 2020 08:48:09 +0000 (16:48 +0800)
修改错误
针对88/-88补码计算的错误

docs/ds/fenwick.md

index 3511d13..98ef081 100644 (file)
@@ -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)}=01011000_{(2)}$ ;  
+ $-x = -88_{(10)} = (10100111_{(2)} + 1_{(2)}) =10101000_{(2)}$ ;  
  $x\ \& \ (-x) = 1000_{(2)} = 8_{(10)}$ 。
 
 神奇吧,我也觉得神奇!