We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://play.golang.org/p/2kMDzm1vAtF
package main import ( "fmt" ) func main() { var x uint64 = ^0 fmt.Println(x) }
I expected it to print the highest uint64 value possible
./prog.go:8:17: constant -1 overflows uint64
The logical complement of 0 should not be assumed to be signed.
The text was updated successfully, but these errors were encountered:
See https://blog.golang.org/constants
Sorry, something went wrong.
Use x := ^uint64(0) instead.
x := ^uint64(0)
Need to use ^uint64(0) as explained https://blog.golang.org/constants#TOC_11%2e
^uint64(0)
No branches or pull requests
What did you do?
https://play.golang.org/p/2kMDzm1vAtF
What did you expect to see?
I expected it to print the highest uint64 value possible
What did you see instead?
The logical complement of 0 should not be assumed to be signed.
The text was updated successfully, but these errors were encountered: