Created
December 25, 2018 00:50
-
-
Save countingtoten/584e1439b2b9d0018e6df12a83b1ed48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
const MaxUint = ^uint(0) | |
const MinUint = 0 | |
const MaxInt = int(^uint(0) >> 1) | |
const MinInt = -MaxInt - 1 | |
fmt.Printf("MinUint: %d\n", MinUint) | |
fmt.Printf("MaxUint: %d (2^32 - 1)\n", MaxUint) | |
fmt.Printf("MinInt: %d (-2^31)\n", MinInt) | |
fmt.Printf("MaxInt: %d (2^31 - 1)\n", MaxInt) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment