Skip to content

Instantly share code, notes, and snippets.

@countingtoten
Created December 25, 2018 00:50
Show Gist options
  • Save countingtoten/584e1439b2b9d0018e6df12a83b1ed48 to your computer and use it in GitHub Desktop.
Save countingtoten/584e1439b2b9d0018e6df12a83b1ed48 to your computer and use it in GitHub Desktop.
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