Home

0b1001000101100

0b1001000101100 is a binary literal often used in programming to denote a number in base-2. The prefix 0b signals that the following digits are binary rather than decimal or hexadecimal. Interpreted as a binary integer, this value equals 4652 in decimal.

The literal consists of 13 bits. When extended to standard 16-bit grouping, it can be represented as

Several bits are set to 1 in this pattern. Specifically, the 1s occur at positions corresponding to

In practice, a binary literal like 0b1001000101100 is often used to represent a bitmask, a combination of

0001001000101100
in
binary,
which
corresponds
to
the
hexadecimal
value
0x122C.
This
helps
relate
the
binary
pattern
to
common
numeral
systems
used
in
computing.
2^12,
2^9,
2^5,
2^3,
and
2^2,
which
sum
to
4096
+
512
+
32
+
8
+
4
=
4652.
The
number
therefore
has
a
popcount
of
5,
meaning
five
bits
are
set
to
1.
flags,
or
a
numeric
constant
in
code.
The
exact
meaning
depends
on
the
context
and
the
data
type
in
use.
Supported
languages
include
Python,
JavaScript
(ES6
and
later),
Java,
and
C#,
among
others;
some
languages
may
impose
width
limits
or
interpret
the
value
as
signed
or
unsigned.