Let be an integral domain, and the absolute value on it. A number in a positional number system is represented as an expansion where The cardinality is called the level of decomposition. A positional number system or coding system is a pair with radix and set of digits, and we write the standard set of digits with digits as Desirable are coding systems with the features:
Every number in, e. g. the integers, the Gaussian integers or the integers, is uniquely representable as a finite code, possibly with a sign ±.
Every number in the field of fractions, which possibly is completed for the metric given by yielding or, is representable as an infinite series which converges under for, and the measure of the set of numbers with more than one representation is 0. The latter requires that the set be minimal, i. e. for real numbers and for complex numbers.
In the real numbers
In this notation our standard decimal coding scheme is denoted by the standard binary system is the negabinary system is and the balanced ternary system is All these coding systems have the mentioned features for and, and the last two do not require a sign.
In the complex numbers
Well-known positional number systems for the complex numbers include the following :
, where the set consists of complex numbers, and numbers, e. g.
, where
Binary systems
Binary coding systems of complex numbers, i. e. systems with the digits, are of practical interest. Listed below are some coding systems and resp. codes for the numbers. The standard binary and the "negabinary" systems are also listed for comparison. They do not have a genuine expansion for. As in all positional number systems with an Archimedeanabsolute value, there are some numbers with multiple representations. Examples of such numbers are shown in the right column of the table. All of them are repeating fractions with the repetend marked by a horizontal line above it. If the set of digits is minimal, the set of such numbers has a measure of 0. This is the case with all the mentioned coding systems. The almost binary quater-imaginary system is listed in the bottom line for comparison purposes. There, real and imaginary part interleave each other.
Base
Of particular interest are the quater-imaginary base and the base systems discussed below, both of which can be used to finitely represent the Gaussian integers without sign. Base, using digits and, was proposed by S. Khmelnik in 1964 and Walter F. Penney in 1965. The rounding region of an integer – i.e., a set of complex numbers that share the integer part of their representation in this system – has in the complex plane a fractal shape: the twindragon. This set is, by definition, all points that can be written as with. can be decomposed into 16 pieces congruent to. Notice that if is rotated counterclockwise by 135°, we obtain two adjacent sets congruent to, because. The rectangle in the center intersects the coordinate axes counterclockwise at the following points:,, and, and. Thus, contains all complex numbers with absolute value ≤. As a consequence, there is an injection of the complex rectangle into the interval of real numbers by mapping with. Furthermore, there are the two mappings and both surjective, which give rise to a surjective mapping which, however, is not continuous and thus not a space-filling curve. But a very close relative, the Davis-Knuth dragon is continuous – and a space-filling curve.