Variable is Int64 type but get error System.OverflowException
Posted on 2006-11-21
I'm trying to do:
Dim MyNumber As Integer
Dim Long_Number As Int64
MyNumber = 407,414
Long_Number = MyNumber * 1024 * 1024
' Result is : 437,690,302,464
But got this error:
System.OverflowException: Arithmetic operation resulted in an overflow.
It is not supposed that a long type number can store up to 9,223,372,036,854,775,807 ?
Also I try to do this:
Long_Number = CType(MyNumber * 1024 * 1024, Int64)
But got this error: Long_Number = 0