Contact: aviboots(AT)netvision.net.il
40,760 questions
53,134 answers
573 users
package main import ( "fmt" "strconv" ) func getBits(n int) string { return strconv.FormatInt(int64(n), 2) } func main() { n := 365 pos := 2 fmt.Println(getBits(n)) n ^= (1 << pos) fmt.Println(getBits(n)) } /* run: 101101101 101101001 */