Home

Longs

Longs is the plural of the data type long, used in many programming languages to denote a larger integer type that extends the range of values beyond a typical int. The term appears in languages such as C, C++, Java, and C#, and is often contrasted with shorter integer types like short or int. In practice, longs are variables that store whole numbers for counters, indices, file positions, and arithmetic results that exceed the capacity of smaller types.

In C and C++, long is a signed integer type with a width that is implementation-dependent. On

In Java, long is a 64-bit signed integer with range −9223372036854775808 to 9223372036854775807. In C#, long

Use of longs involves considerations of portability and performance. If exact width is required, languages provide

Windows
64-bit,
long
is
32
bits;
on
many
Unix-like
systems
it
is
64
bits
(the
LP64
model).
The
C
standard
also
provides
long
long,
which
is
at
least
64
bits.
Typical
ranges
include
−2147483648
to
2147483647
for
a
32-bit
long,
and
−9223372036854775808
to
9223372036854775807
for
a
64-bit
long.
is
an
alias
for
System.Int64.
Python
2
distinguishes
int
and
long,
while
Python
3
uses
a
single
arbitrary-precision
int,
so
there
is
no
separate
long
type
in
Python
3.
fixed-width
types
such
as
int32_t
and
int64_t;
otherwise
the
actual
size
of
long
depends
on
the
platform.
In
most
modern
environments
longs
are
represented
in
two's
complement,
but
representations
are
not
guaranteed
by
language
standards.
See
also:
short,
int,
long
long,
size_t.