|rational to floating point email@example.com (Thant Tessman) (2003-03-09)|
|Re: rational to floating point firstname.lastname@example.org (David Chase) (2003-03-14)|
|Re: rational to floating point email@example.com (2003-03-14)|
|Re: rational to floating point firstname.lastname@example.org (Thant Tessman) (2003-03-14)|
|Re: rational to floating point email@example.com (Joachim Durchholz) (2003-03-14)|
|Re: rational to floating point firstname.lastname@example.org (Arthur J. O'Dwyer) (2003-03-14)|
|Re: rational to floating point email@example.com (Glen Herrmannsfeldt) (2003-03-14)|
|Re: rational to floating point firstname.lastname@example.org (2003-03-14)|
|[2 later articles]|
|From:||David Chase <email@example.com>|
|Date:||14 Mar 2003 11:05:55 -0500|
|Organization:||Little or none|
|Posted-Date:||14 Mar 2003 11:05:55 EST|
Thant Tessman wrote:
>The question is: Under what conditions will a rational number produce
>an infinite stream of digits for a given base?
You need _The Book of Numbers_, by John H. Conway and Richard K. Guy.
You needed this book anyway, but your question is answered is on page
156-163, where they also explain how many digits there are in the
repeating portion when a rational number's decimal expansion repeats
A denominator D that has a terminating expansion has the property that
there is a number L such that 10-to-the-L is congruent to 0, modulo D.
(Hence 10 mod 2 = 0, 100 mod 4 = 0, 1000 mod 8 = 0, etc). Obviously
this generalizes to bases other than 10.
For denominator P, the length of the first cycle is the smallest
number L with 10-to-the-L congruent to 1, modulo P. They provide the
result that if P is prime, all cycles have the same length (i.e., for
a given prime denominator, the cycles will have the same length no
matter what the numerator. The cycle length need not be P-1, but it
will always divide P-1.
So, there's a start.
Return to the
Search the comp.compilers archives again.