C Sharp long
From Coderwiki
More actions
The long class in C Sharp is a data type which can store positive and negative whole numbers in variables.
See Integer for generic information about what integers and longs can represent and how they are represented in memory.
Size
edit edit sourceA long in C# is represented by 8 bytes, or 64 bits.
This means it can store integral values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
For less extreme integers (anything between -2,147,483,648 to 2,147,483,647), you can use the C Sharp int data type instead, which uses less space in memory.
Example
edit edit sourcelong a;
long b = 74;
long c = (long)15.2; // 15