Home

0b01111111111111111111111111111111

0b01111111111111111111111111111111 is a binary literal that encodes a 32-bit value. In binary, the most significant bit is 0 and the remaining 31 bits are 1.

Value and interpretation:

As an unsigned 32-bit integer, this pattern equals 2,147,483,647. In a signed 32-bit two’s complement representation,

Equivalent representations:

The same value is often written as hexadecimal 0x7FFFFFFF and decimal 2147483647.

Context and usage:

Binary literals with a 0b prefix appear in several programming languages, such as Python, JavaScript (ECMAScript

Notes:

While the value is tied to a 32-bit width, actual storage depends on the language and platform;

it
denotes
the
maximum
positive
integer,
commonly
referred
to
as
INT_MAX,
since
the
sign
bit
is
0
and
all
other
bits
are
1.
6
and
later),
and
C++14
and
newer.
This
particular
bit
pattern
is
frequently
encountered
in
discussions
of
limits,
bitwise
operations,
or
tests
involving
the
maximum
32-bit
signed
integer.
It
is
distinct
from
-1,
which
in
32-bit
two’s
complement
is
represented
by
all
bits
set
to
1
(0xFFFFFFFF).
endianness
affects
byte
order
in
memory
but
not
the
numerical
value.