janmr blog

Multiple-Precision Number Representation

Let us consider a common way to represent non-negative integers. An integer will be represented in radix using the notation

We will call an -digit number and its digits. Zero will be represented with no digits, . Observe that

for any .

Unless stated otherwise we will always have that the most-significant digit is non-zero, that is, for . This assumption has some important consequences. First, that

for any . Secondly, that each non-negative integer has a unique representation, that is, to each number and radix corresponds exactly one and digits such that . Thirdly, that

This last relation can be quite useful since the number of needed digits can be found, given and . For instance, the fact that means that the number 1317803400 can be represented using 31 binary digits.