In general in a number system with a base or radix r, the digits used are from 0 to r-1 and the number can be represented as
Equation (1) is for all integers and for the fractions (numbers between 0 and 1), the following equation holds.