+ 1
What is the difference between Convert.ToInt32 and Convert.ToInt64???
2 Answers
+ 4
Convert.ToInt32() will return a 32 bit signed integer (Int32). It can only properly hold numbers in a range that can be held in 32 bits. It thusly has a size of 4 bytes of memory.
https://docs.microsoft.com/en-us/dotnet/api/system.convert.toint32?view=netcore-3.1
Likewise, with Convert.ToInt64 it will return a 64 bit signed integer (Int64) with a size of 8 bytes of memory.
https://docs.microsoft.com/en-us/dotnet/api/System.Convert.ToInt64?view=netcore-3.1
+ 3
I don't know, but it would make sense that int32 is an integer requiring 4 bytes of memory and int64 requiring 8 bytes of memory.
Thus int32 would be limited to a value between (-256^4/2) and (256^4/2-1).
And int64 would be limited to a value between (-256^8/2) and (256^8/2-1).