Last active
April 10, 2018 05:40
-
-
Save woodsleaf/29786d24987053d5087345848eec523f to your computer and use it in GitHub Desktop.
Revisions
-
woodsleaf revised this gist
Apr 10, 2018 . 1 changed file with 7 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 @@ -6,4 +6,10 @@ def turnon(a): return desired a = 0b10111011 print(bin(turnon(a))) #flip #a = 0b11101110 #mask = 0b11111111 #desired = a ^ mask #print(bin(desired)) -
woodsleaf created this gist
Apr 10, 2018 .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,9 @@ def turnon(a): mask = 0b100 desired = a | mask # print(bin(desired)) # if a != desired: return desired a = 0b10111011 print(bin(turnon(a)))