February 2010
Beginner
400 pages
11h 13m
English
Now that the lowdown changes are out of the way, lets look at some of the new types in .NET 4.0 and modifications to existing classes and methods.
Working with really big numbers in .NET can get a bit strange. For example, try the following example (without advanced options such as overflow checking), and you might be surprised at the result you get:
int a = 2000000000; Console.WriteLine(a * 2); Console.ReadKey();
Surely the result is 4000000000? Running this code will give you the following answer:
−294967296
NOTE
VB.NET won't even let you compile the equivalent.
This issue occurs due to how this type of integer is represented in binary and the overflow that occurs. After the multiplication, the number gets ...