bool t = true; bool f = false; var a = Unsafe.As<bool, int>(ref t); var b = Unsafe.As<bool, int>(ref f); Console.WriteLine(a); // 1 Console.WriteLine(b); // 0