Skip to content

Commit 2af1430

Browse files
arnoldYuChengKai
authored andcommitted
fix & -> ^ in algorithm-ch/en.md
1 parent 29dbd51 commit 2af1430

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Algorithm/algorithm-ch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
```js
103103
8 ^ 7 // -> 15
104104
8 ^ 8 // -> 0
105-
// 1000 & 0111 -> 1111 -> 15
106-
// 1000 & 1000 -> 0000 -> 0
105+
// 1000 ^ 0111 -> 1111 -> 15
106+
// 1000 ^ 1000 -> 0000 -> 0
107107
```
108108

109109
从以上代码中可以发现按位异或就是不进位加法

Algorithm/algorithm-en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ Each bit is different, and the result is 1
6666
```js
6767
8 ^ 7 // -> 15
6868
8 ^ 8 // -> 0
69-
// 1000 & 0111 -> 1111 -> 15
70-
// 1000 & 1000 -> 0000 -> 0
69+
// 1000 ^ 0111 -> 1111 -> 15
70+
// 1000 ^ 1000 -> 0000 -> 0
7171
```
7272

7373
From the above code, we can find that the bitwise XOR is the not carry addition.

0 commit comments

Comments
 (0)