Appendix A. NUMBER BASES

Our method for writing numbers is based on powers of 10. For example, consider the number 2468. The 2 represents 2 thousands, the 4 represents 4 hundreds, the 6 represents 6 tens, and the 8 represents 8 ones:

One thousand is 10×10×10, which can be written as 10[3], or 10 to the 3rd power. Using this notation, we can write the preceding relationship this way:

Because our number notation is based on powers of 10, we refer to it as base 10, or decimal, notation. One can just as easily pick another number as a base. C++ lets ...

Get C++ Primer Plus, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.