int64 capacity code example
Example 1: Int64
decimal[] values= { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
199.55m, 9214.16m, Decimal.MaxValue };
long result;
foreach (decimal value in values)
{
try {
result = Convert.ToInt64(value);
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
value.GetType().Name, value,
result.GetType().Name, result);
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int64 type.",
value);
}
}
Example 2: int32 vs int64
Int32 and Int64 are defined by their names. Int32 is a signed, thirty-two byte integer value (4 bytes), and an int64 is a signed, sixty-four bit integer value (8 bytes). Int32 has a min/max of 2.147 billion and int64 has a min/max of 9223 with a lot of zeroes