Fractional Parts
The digits of the fractional part of a number x expressed in base r are obtained by repeatedly multiplying by r and taking the integer part. The following function gives a list of the first d digits in the expansion of a fractional part x in base r. x is originally in base 10. This algorithm can also be expressed recursively in a very natural way.
Here we try it with the fractional part of π.
| Created by Mathematica (June 3, 2006) |