gpt4 book ai didi

go - 为什么 golang 移位运算符优先于加法?

转载 作者:IT王子 更新时间:2023-10-29 02:32:01 25 4
gpt4 key购买 nike

<分区>

java:  System.out.println(1 + (9 - 1) >> 1);  // OUPUT: "4"
golang: fmt.Println(1 + (9 - 1) >> 1) // OUPUT: "5"

Go:https://kuree.gitbooks.io/the-go-programming-language-report/content/31/text.html

Java:https://introcs.cs.princeton.edu/java/11precedence/

python :http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html

C/C++:http://en.cppreference.com/w/c/language/operator_precedence

似乎只有 golang >> 优先于 +?但是为什么?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com