diff --git a/Algorithm/algorithm-ch.md b/Algorithm/algorithm-ch.md index 14526e6f..4aea4602 100644 --- a/Algorithm/algorithm-ch.md +++ b/Algorithm/algorithm-ch.md @@ -102,8 +102,8 @@ ```js 8 ^ 7 // -> 15 8 ^ 8 // -> 0 -// 1000 & 0111 -> 1111 -> 15 -// 1000 & 1000 -> 0000 -> 0 +// 1000 ^ 0111 -> 1111 -> 15 +// 1000 ^ 1000 -> 0000 -> 0 ``` 从以上代码中可以发现按位异或就是不进位加法 diff --git a/Algorithm/algorithm-en.md b/Algorithm/algorithm-en.md index f9e21662..217f6a57 100644 --- a/Algorithm/algorithm-en.md +++ b/Algorithm/algorithm-en.md @@ -66,8 +66,8 @@ Each bit is different, and the result is 1 ```js 8 ^ 7 // -> 15 8 ^ 8 // -> 0 -// 1000 & 0111 -> 1111 -> 15 -// 1000 & 1000 -> 0000 -> 0 +// 1000 ^ 0111 -> 1111 -> 15 +// 1000 ^ 1000 -> 0000 -> 0 ``` From the above code, we can find that the bitwise XOR is the not carry addition.