Repeating Decimals
|
01-21-2018, 10:41 PM
(This post was last modified: 01-21-2018 10:43 PM by Joe Horn.)
Post: #13
|
|||
|
|||
RE: Repeating Decimals
(01-21-2018 10:22 PM)StephenG1CMZ Wrote: Jo Horn, it occurs to me that there is an important difference between your latest algorithm and the earlier one using Multiplicative Order, that might mean the earlier algorithm remains useful. Correct. The non-multiplicative-order algorithm is much simpler to code, but for large repeating sections it runs much slower. In fact, if you use instead the algorithm which pre-calculates the repeating section's length (using the multiplicative order), ALL of decimal number's digits (both the transient and repeating sections) can be obtained with a SINGLE simple calculation, without any looping at all. It would make a Prime program for fraction-to-repeating-decimal a bazillion timers faster than the non-multiplicative-order algorithm, even for huge denominators. I'll keep watching these discussions to see if anybody programs this method... if they haven't already. EDIT: Ooh ooh, I see above that you have! Do you generate the digits by looping or all at once? I gotta go look... <0|ΙΈ|0> -Joe- |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)