Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec: operators/shift misleading comment #14785

Closed
powerman opened this issue Mar 11, 2016 · 4 comments
Closed

spec: operators/shift misleading comment #14785

powerman opened this issue Mar 11, 2016 · 4 comments

Comments

@powerman
Copy link

In this example:

var n = 1.0<<s != i    // 1.0 has type int; n == false if ints are 32bits in size

phrase "if ints are 32bits in size" makes no sense - n is always false, both on 32- and 64-bit.

@griesemer griesemer self-assigned this Mar 11, 2016
@griesemer griesemer added this to the Go1.7 milestone Mar 11, 2016
@minux
Copy link
Member

minux commented Mar 12, 2016 via email

@powerman
Copy link
Author

i is 1<<s. Other side is the same, and 32/64 bit makes no difference. So either this example was meant to demonstrate something else, or you can just remove "if ints are 32bits in size" part and keep the rest as is.

@griesemer
Copy link
Contributor

@powerman Agreed. This is a leftover historic comment. Will try to change this into an example that is making a point again.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/22353 mentions this issue.

@golang golang locked and limited conversation to collaborators Apr 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants