Home

UINT64MAX

UINT64MAX refers to the maximum value representable by an unsigned 64-bit integer. In standard programming practice, the corresponding type is uint64_t, defined by the C standard library header stdint.h and by cstdint in C++. The portable macro that represents this maximum value is UINT64_MAX. Some informal references shorten or misname it as UINT64MAX, but the canonical name is UINT64_MAX.

The value of UINT64_MAX is 2^64 − 1, which equals 18446744073709551615 in decimal and 0xFFFFFFFFFFFFFFFF in hexadecimal.

Usage and considerations: UINT64_MAX is used for bounds checks, initialization, and defining limits in portable code

Relation to standards: The macro is part of the standard integer-capacity limits defined for fixed-width types.

In
binary
terms,
every
one
of
the
64
bits
is
set
to
1,
making
it
the
largest
unsigned
value
possible
for
a
64-bit
type.
This
macro
is
defined
only
if
a
64-bit
unsigned
integer
type
exists
on
the
platform.
that
relies
on
fixed-width
integer
types.
When
writing
numeric
literals
that
represent
this
maximum,
languages
commonly
require
a
suffix
such
as
ULL
to
ensure
the
literal
is
treated
as
an
unsigned
64-bit
value
(e.g.,
18446744073709551615ULL
or
0xFFFFFFFFFFFFFFFFULL).
It
helps
ensure
consistent
behavior
across
compilers
and
architectures
that
provide
a
64-bit
unsigned
integer
type.
See
also:
UINT64_MAX,
UINT32_MAX,
UINTMAX_MAX,
stdint.h,
cstdint.