Home

0b1

0b1 is a binary literal formed by the prefix 0b followed by binary digits. In base-2 notation, the digits after the prefix are read as bits, so 0b1 represents the decimal value 1. Other common binary literals include 0b10 (2) and 0b1010 (10).

In programming, the 0b prefix is used to express integer constants directly in base 2. This makes

Common language support includes Python, JavaScript (ES6), Java (since Java 7), C++ (since C++14), and Rust, all

Summary: 0b1 denotes the binary value 1. The 0b prefix signals a base-2 literal in many modern

it
convenient
to
specify
bit
patterns,
masks,
and
flags
without
converting
from
decimal.
The
exact
rules—such
as
which
digits
are
allowed
after
0b
and
whether
readability
separators
are
permitted—depend
on
the
language.
of
which
allow
0b-prefixed
binary
literals.
Some
languages
also
permit
underscores
for
readability
(for
example,
0b1010_0011).
Note
that
not
all
languages
support
binary
literals,
and
some
older
contexts
may
treat
numeric
literals
with
leading
zeros
as
octal
values
or
apply
other
rules.
programming
languages,
with
usage
and
syntax
varying
by
language
but
sharing
the
underlying
concept
of
representing
numbers
as
binary
digits.
See
also
hexadecimal
literals
(0x)
and
general
binary
notation
in
computer
science.