Last active
April 10, 2025 10:58
-
-
Save deeagle/006b2d260e8931dd46cc84d734ecb04e to your computer and use it in GitHub Desktop.
Revisions
-
deeagle revised this gist
Apr 10, 2025 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -19,5 +19,10 @@ func main() { xandy := x & y xory := x | y fmt.Printf("x & y = %3d - %s\n", xandy, strconv.FormatInt(int64(xandy), 2)) fmt.Printf("y | y = %3d - %s\n\n", xory, strconv.FormatInt(int64(xory), 2)) xy := x + y xysl2 := xy >> 2 fmt.Printf("x + y = %3d - %9s\n", xy, strconv.FormatInt(int64(xy), 2)) fmt.Printf("x + y >> 2 = %3d - %9s\n", xysl2, strconv.FormatInt(int64(xysl2), 2)) } -
deeagle created this gist
Apr 10, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ package main import ( "fmt" "strconv" ) func main() { fmt.Println("hello") fmt.Printf("^2 index = %3d %2d %2d %2d %1d %1d %1d %1d\n", 8, 7, 6, 5, 4, 3, 2, 1) fmt.Printf("^2 result = %3d %2d %2d %2d %1d %1d %1d %1d\n\n", 128, 64, 32, 16, 8, 4, 2, 1) var x, y int = 100, 90 fmt.Printf("x = %3d - %s\n", x, strconv.FormatInt(int64(x), 2)) fmt.Printf("y = %3d - %s\n\n", y, strconv.FormatInt(int64(y), 2)) xandy := x & y xory := x | y fmt.Printf("x & y = %3d - %s\n", xandy, strconv.FormatInt(int64(xandy), 2)) fmt.Printf("y | y = %3d - %s\n", xory, strconv.FormatInt(int64(xory), 2)) }