Let us consider a common way to represent non-negative integers. An integer u≥0 will be represented in radix b≥2 using the notation
u=(un−1…u1u0)b=k=0∑n−1ukbk,0≤uk≤b−1.
We will call u an n-digit number and u0,u1,… its digits. Zero will be represented with no digits, 0=()b. Observe that
u≤((b−1)…(b−1)(b−1))b=k=0∑n−1(b−1)bk=bn−1
for any n≥0.
Unless stated otherwise we will always have that the most-significant digit is non-zero, that is, un−1=0 for n≥1. This assumption has some important consequences. First, that
u≥(10…0)b=bn−1
for any n≥1. Secondly, that each non-negative integer has a unique representation, that is, to each number u≥0 and radix b≥2 corresponds exactly one n≥0 and digits u0,u1,…,un−1 such that u=(un−1…u1u0)b. Thirdly, that
bn−1≤u<bn⇔n−1≤logb(u)<n⇔⌊logb(u)⌋=n−1.
This last relation can be quite useful since the number of needed digits can be found, given u and b. For instance, the fact that ⌊log2(1317803400)⌋+1=31 means that the number 1317803400 can be represented using 31 binary digits.