Library/Arithmetic/Number systems

Number systems

Practice
Overview
Important

A number system is a method for expressing numbers using a consistent set of digits and a base. The base (or radix) determines how many unique digits are used and how place values increase. For example, in base bb, each digit represents a multiple of a power of bb.

Important properties

  • A number in base bb is written as dndn1ldotsd1d0d_n d_{n-1} \\ldots d_1 d_0, where each did_i is a digit from 00 to b1b-1.

  • The value is dnbn+dn1bn1+ldots+d1b1+d0b0d_n b^n + d_{n-1} b^{n-1} + \\ldots + d_1 b^1 + d_0 b^0.

  • Common bases: decimal (10), binary (2), ternary (3), hexadecimal (16).

  • Changing bases involves converting numbers by expressing them in terms of another base.