O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Other Bases

It is not a coincidence that we use base 10; we have 10 fingers. One can imagine a different base, however. Using the rules found in base 10, you can describe base 8:

  1. The digits used in base 8 are 0–7.

  2. The columns are powers of 8: 1s, 8s, 64s, and so on.

  3. With n columns you can represent 0 to (8n–1).

To distinguish numbers written in each base, write the base as a subscript next to the number. The number fifteen in base 10 would be written as 1510 and read as “one, five, base ten.”

Thus, to represent the number 1510 in base 8 you would write 178. This is read “one, seven, base eight.” Note that it can also be read “fifteen” as that is the number it continues to represent.

Why 17? The 1 means 1 eight, and the 7 means 7 ones. One eight ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required