Last active
December 13, 2015 22:29
-
-
Save staafl/4984699 to your computer and use it in GitHub Desktop.
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
// what's printed? | |
Console.WriteLine("null is object: " + (null is object)); | |
Console.WriteLine("null is IDisposable: " + (null is IDisposable)); | |
Console.WriteLine("null is int: " + (null is int)); | |
Console.WriteLine("null is int?: " + (null is int?)); | |
Console.WriteLine("null is Func<int>: " + (null is Func<int>)); | |
Console.WriteLine("null is FileMode: " + (null is FileMode)); | |
Console.WriteLine("0 is FileMode: " + (0 is FileMode)); | |
Console.WriteLine("0 is int?: " + (0 is int?)); | |
Console.WriteLine("short over short: " + (((short)10)/((short)5)).GetType()); | |
Console.WriteLine((Exception)null); | |
// can your computer do arithmetic? | |
Console.WriteLine(1.0 + 1.0 == 2.0); | |
Console.WriteLine(0.01 + 0.01 == 0.02); | |
Console.WriteLine(0.00000037 + 0.0000001 == 0.00000047); | |
Console.WriteLine(0.9999999+0.000001 == 1.0); | |
Console.WriteLine(1.000001-0.000001 ==1.0); | |
// assume InvariantCulture | |
Console.WriteLine(4.170404 == Convert.ToDouble("4.170404")); | |
// what's printed? | |
for(int ii = 0; ii < 10; ++ii) | |
Console.WriteLine(new Random().Next(0, Int32.MaxValue)); | |
// what happens here? | |
throw null; | |
// asume GetException() { return new Exception(); } | |
throw GetException(); | |
throw ((() => new Exception())()); | |
throw ((() => {throw new Exception();})()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment