Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Int64.MaxValue return a Long?

Huh that's ironic ,while playing around today i wondered if a can Increase Int64.MaxValue on some way ,and just founded out that Int64.MaxValue isn't an Int64 but a Long .

Why is that ,does it mean if i store like Int64 myInt = Int64.MaxValue; than myInt will be still an Int or it will become a Long ,what's the purpose of storing a Long Instead of Int64 at this Field .

like image 637
Rosmarine Popcorn Avatar asked Nov 02 '11 14:11

Rosmarine Popcorn


People also ask

Is an Int64 A Long?

In C#, Int64 Struct is used to represent 64-bit signed integer(also termed as long data type) starting from range -9,223,372,036,854,775,808 to +9, 223,372,036,854,775,807.

What is Int64 MaxValue?

string. int64. A 64-bit signed integer. It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive).

What is the difference between long and Int64?

There is no difference in the compiled code. They are aliases for the same thing.

Is Int64 and long same C#?

In C#, long is mapped to Int64. It is a value type and represent System. Int64 struct. It is signed and takes 64 bits.


2 Answers

Because Int64 and long are same type.

Int64 = long    
Int32 = int    
Int16 = short
like image 138
Ekk Avatar answered Oct 04 '22 20:10

Ekk


long is a synonym of Int64

Reference: http://msdn.microsoft.com/en-us/library/ctetwysk(v=VS.100).aspx

like image 39
Kirill Polishchuk Avatar answered Oct 04 '22 22:10

Kirill Polishchuk