Last active
April 16, 2020 23:08
-
-
Save sshaplygin/522966095363c21b7c50d0aae86a1ec5 to your computer and use it in GitHub Desktop.
Golang max and min math constants with bytes shifts from SOF https://stackoverflow.com/questions/6878590/the-maximum-value-for-an-int-type-in-go
This file contains 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
const MaxUint = ^uint(0) | |
const MinUint = 0 | |
const MaxInt = int(MaxUint >> 1) | |
const MinInt = -MaxInt - 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment