Skip to content

Instantly share code, notes, and snippets.

@joshuaaguilar20
Created September 6, 2019 23:14
Show Gist options
  • Save joshuaaguilar20/f300cd579fdb465d4ea8cc5187bee83b to your computer and use it in GitHub Desktop.
Save joshuaaguilar20/f300cd579fdb465d4ea8cc5187bee83b to your computer and use it in GitHub Desktop.
Bit Shifting Go Lang
package main
import "fmt"
func main() {
// x:= 4
// fmt.Printf("%d\t\t%b\n", x, x)
// y:= x << 1
// fmt.Printf("%d\t\t%b", y,y)
/*
Output
4 100
8 1000
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment