# Long

Long is a data type used in programming languages, such as Java, C++, and C#. A constant or variable defined as long can store a single 64-bit signed integer.

So what constitutes a 64-bit signed integer? It helps to break down each word, starting from right to left. An integer is a whole number that does not include a decimal point. Examples include 1, 99, or 234536. "Signed" means the number can be either positive or negative, since it may be preceded by a minus (-) symbol. 64-bit means the number can store 2^{63} or 18,446,744,073,709,551,616 different values (since one bit is used for the sign). Because the long data type is signed, the possible integers range from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, including 0.

In modern programming languages, the standard integer (int) data type typically stores a 32-bit whole number. Therefore, if a variable or constant may potentially store a number larger than 2,147,483,647 (2^{31} ÷ 2), it should be defined as a long instead of an int.

**NOTE:** In standard C, a long integer may be limited to a 32-bit value ranging from -2,147,483,648 to 2,147,483,647.

Updated: December 5, 2015