Created
May 26, 2016 08:14
-
-
Save ufcpp/fe6788898ca4b91f0067dd7017af6ca4 to your computer and use it in GitHub Desktop.
Revisions
-
ufcpp created this gist
May 26, 2016 .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,37 @@ using System; class Program { static void Main() { Write(false); Write(true); Write(Bool(0)); // false と一緒 Write(Bool(1)); // true と一緒 Write(Bool(2)); // false でも true でもない何か } private static unsafe bool Bool(byte value) { bool b = false; *((byte*)&b) = value; return b; } static void Write(bool x) { switch (x) { case true: Console.WriteLine("True"); break; case false: Console.WriteLine("False"); break; default: Console.WriteLine("Other "); break; } } }