I have following code:
Dim len As Int32 = 1000
Dim rdlen As Int64 = 2000000000000
Dim totlen As Int64
Which example is the correct way to use System.Convert.ToInt64 function?
Example one:
totlen = System.Convert.ToInt64(rdlen + len)
Example two:
totlen = rdlen + System.Convert.ToInt64(len)
I think both examples are correct. At least in c#.
When A and B is of different integer type, compiler should convert both of them to the same type in order to do A+B. So it converts both to Int64 before computing A+B.