&^在Go中的含义是什么?
在以下代码中,输出为8,因此二进制为1000。
为什么这样?
a := 10
b: = 3
fmt.Println(a &^ b)
fmt.Printf("a &^ b: %b\n", uint64(a &^ b))
这在戈兰。有人告诉我,当零件为0时,它将在1中输出,但这将导致0100,即4。
In the following piece of code, the output is 8 and therefore 1000 in binary.
Why is this the case?
a := 10
b: = 3
fmt.Println(a &^ b)
fmt.Printf("a &^ b: %b\n", uint64(a &^ b))
This is in golang. I have been told it is when the bits are both 0 it will output in 1, but this would result in 0100, which is 4.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论