Long

 
 
 

A Long integer is an integer value with a larger range than short integers. Because of their capacity to represent a larger range of values than their short integer counterparts, they are larger (use more memory).

Language

Comments

VBScript

The VBScript Long integer type contains an integer in the range -2,147,483,648 to 2,147,483,647.

JScript

JScript uses a generic "number" data type which corresponds to integer values as well as floating point values. There is no specific Long integer type in JScript.

Python

Python supports an integer type which is 32-bit or 64-bit depending on the platform, and a long integer object which supports unlimited range.

C++

The size of long in C++ is not the same on windows-64 (32 bits) as on linux-64 (64 bits). The C++ API defines its own types for long integers to overcome this platform dependency problem:

  • LONG: 32 bits

  • LLONG: 64 bits

C#

There are a number of data types available:

  • int: Signed 32-bit integer in the range -2,147,483,648 to 2,147,483,647 (System.Int32)

  • uint: Unsigned 32-bit integer in the range 0 to 4,294,967,295 (System.UInt32)

  • long: Signed 64-bit integer in the range –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (System.Int64)

  • ulong: Unsigned 64-bit integer in the range 0 to 18,446,744,073,709,551,615 (System.UInt64)

Tip

See Comparing Data Types across Languages for a table that compares the long integer data type across several different languages.

For high-level information about how these languages approach data type in general, see one of the following topics:

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License