How can a negative integer be represented as a binary in Go, using the two's complement notation?
For example:
n := int64(-1)
fmt.Printf("%b", n)
fmt.Println(strconv.FormatInt(n, 2))
Both lines print -1
. The result shoud be like ffffffffffffffff
.