Home

0o5

0o5 is a numeric literal used to denote the octal number five in programming languages that use the 0o prefix for octal notation. The prefix "0o" (zero followed by a lowercase o) signals that the digits that follow are interpreted in base 8 rather than decimal. In octal, digits range from 0 to 7, and the value of 0o5 equals the decimal number 5.

Usage and languages

Python 3 uses the 0o prefix for octal literals, replacing the older leading-zero notation of Python 2.

Significance

Octal notation is historical but remains encountered in computing contexts, especially in Unix-like file permissions and

For
example,
0o755
represents
the
octal
number
755,
commonly
used
to
specify
file
permissions;
in
decimal,
that
value
is
493.
JavaScript
added
octal
literals
with
the
0o
prefix
in
ES6;
0o5
in
JavaScript
also
equals
5.
In
C
and
C++,
octal
values
can
be
written
with
a
leading
zero
(for
example
0755),
but
the
0o
prefix
is
not
standard
in
those
languages.
The
use
of
0o
helps
avoid
confusion
with
decimal
numbers
that
start
with
a
zero
in
some
languages.
legacy
code.
Because
each
octal
digit
maps
to
three
binary
bits,
octal
is
a
convenient
compact
representation
for
certain
bit
masks
and
permission
sets.
The
simple
value
0o5
illustrates
how
octal
digits
translate
to
its
decimal
equivalent,
reinforcing
the
base-8
relationship.