Hi,
Can someone explain me the reason of overflow in variable a? Note that b is bigger than a.
static void Main(string[] args)
{
int i = 2;
long a = 1024 * 1024 * 1024 * i;
long b = 12345678901234567;
System.Console.WriteLine("{0}", a);
System.Console.WriteLine("{0}", b);
System.Console.WriteLine("{0}", long.MaxValue);
}
-2147483648
12345678901234567
9223372036854775807
Press any key to continue . . .
Thanks!