|
![](/i/fill.gif) |
=?ISO-8859-1?Q?=22J=E9r=F4me_M=2E_Berger=22?= <jeb### [at] free fr> wrote:
> Jay Fox wrote:
> > On the other hand, 1234.56789 has a period of 116,032,317, and 123.4567
> 89 has a
> > period of 1,078,493,612. Finally, a value of s of 12.3456789 has a peri
> od in
> > excess of a hundred billion (i.e., my program is still running, having
> already
> > produced over 110 billion iterates).
> >
> Note that due to rounding error, you might never get the first
> value back. I.e it is quite possible for the algorithm to go: 1, 2,
> 3, 2, 3, 2, 3...
>
Yeah, I took that into account. I calculated the first iterate, then checked if
the next iterate matched (sounds silly, but it was part of a loop).
Then I checked the third and fourth to see if they matched the second value.
Then the fifth through eighth to see if they matched the fourth. Then 9th-16th
to see if they matched the 8th. And so on. If there's a period, it's guaranteed
to be found.
For example, one particular s value went through over a six billion iterates
before settling into a period of about 15 million. Weird, huh?
Post a reply to this message
|
![](/i/fill.gif) |