DEV Community

harshraj8843 for ilihub

Posted on • Originally published at ilihub.tech

What is an Octal Number?

An octal number is a number that uses the base-8 numbering system. This means that each digit in an octal number represents a power of 8. Octal numbers are not as commonly used as decimal or hexadecimal numbers, but they are still used in some areas of computing.

In the octal numbering system, the digits 0-7 represent the values 0-7. For example, the octal number 123 can be represented as:

1×82+2×81+3×80 1 \times 8^2 + 2 \times 8^1 + 3 \times 8^0

In this representation, the first digit (1) represents 64 ( 1×821 \times 8^2 ), the second digit (2) represents 16 ( 2×812 \times 8^1 ), and the third digit (3) represents 3 ( 3×803 \times 8^0 ). When you add these values together, you get the decimal number 83.

1×82+2×81+3×80=64+16+3=83 1 \times 8^2 + 2 \times 8^1 + 3 \times 8^0 = 64 + 16 + 3 = 83

In addition to octal numbers, there are other numbering systems, such as binary and hexadecimal, that are used in computing. However, octal numbers are not as commonly used as these other numbering systems.

Examples

The following table shows the decimal, binary & octal representations of the numbers 0 through 7:

Decimal Binary Octal
0 000 0
1 001 1
2 010 2
3 011 3
4 100 4
5 101 5
6 110 6
7 111 7

References


Top comments (0)