I am working on a project for school in which I would need to sum up hundreds of rational values to over one trillion sig figs (done in code) however it is not practical to store each term in the sequence as the file will become to large, however because all of the numbers are rational they are either finite, which is better, or they are infinite, but still rational so they have to repeat, so my question is: is there a mathematical way to tell the length of the pattern, for example 1/14 is 0.0[714285][714285] with the [714285] bit repeating infinite times.
any help would be much appreciated Thank you in advance!!