The below table visualizes how the decimal number 1000000000000 equals the octal number 16432451210000.
1 | × | 813 | = | 549755813888 | |
+ | 6 | × | 812 | = | 412316860416 |
+ | 4 | × | 811 | = | 34359738368 |
+ | 3 | × | 810 | = | 3221225472 |
+ | 2 | × | 89 | = | 268435456 |
+ | 4 | × | 88 | = | 67108864 |
+ | 5 | × | 87 | = | 10485760 |
+ | 1 | × | 86 | = | 262144 |
+ | 2 | × | 85 | = | 65536 |
+ | 1 | × | 84 | = | 4096 |
+ | 0 | × | 83 | = | 0 |
+ | 0 | × | 82 | = | 0 |
+ | 0 | × | 81 | = | 0 |
+ | 0 | × | 80 | = | 0 |
= | 1000000000000 |
Octal numbers are a positional numeral system with the base (or "radix") 8, which means it consists of the digits 0, 1, 2, 3, 4, 5, 6 och 7. In the octal system, the number 8 is written as 10.
Since 8 is equal to 23, each octal digit can be used to describe three binary digits. This was frequently used early on in the computer era, when the word length in computer processors was often a multiple of 3, such as 6, 12 or 24 bits. In modern computers the word length is usually a multiple of 8, such as 32 or 64 bits, and therefore hexadecimal numbers are better suited to describe data nowadays.
The octal system is built in into many programming languages, and an octal number can usually be declared by starting the number with a 0. You can easily test this in JavaScript by opening the Console in your web browser (normally by the F12 key) and typing in 010. The browser will return the number 8. If you type in 011, it will return 9, and so on.