Created
September 5, 2017 21:38
-
-
Save joekir/177f2a25ebd6a7c5026bf4cc6836c309 to your computer and use it in GitHub Desktop.
Weird differences in behaviours
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
package main | |
import "fmt" | |
func main() { | |
const big int = 0x7FFFFFFF/2 | |
s := [big]int{3} | |
fmt.Println(s[big-1]) | |
} |
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
package main | |
import "fmt" | |
func main() { | |
const big int = 0x7FFFFFFF/2 | |
s := [big]int{} | |
fmt.Println(s[big-1]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment