Real numbers
To get the radix r representation of a real number its integer and fractional parts are dealt with separately. The function Radix gives two lists, the first one contains the digits of the integer part of x in base r, and the second one has the first d digits of the fractional part of x in base r. The number x is originally in base 10. Of course, it relies on the previously defined functions for integer and fractional parts.
As a first example we find the binary representation of π, up to 25 binary digits.
This example expresses the first 54 digits of the base 26 representation of π as the letters of the alphabet.
Another example in base 26 using the letters of the alphabet as digits. Note that we obtain an answer consistent with a previous example with function R.
| Created by Mathematica (June 3, 2006) |