Created
September 6, 2019 23:14
-
-
Save joshuaaguilar20/f300cd579fdb465d4ea8cc5187bee83b to your computer and use it in GitHub Desktop.
Bit Shifting Go Lang
This file contains hidden or 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() { | |
// 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