Post Reply 
Repeating Decimals
01-21-2018, 10:22 PM (This post was last modified: 01-21-2018 10:48 PM by StephenG1CMZ.)
Post: #12
RE: Repeating Decimals
Joe 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.

If I understand your latest algorithm correctly, it outputs the transient part and then keeps producing the recurring part until it identifies that it is going to repeat.

That means there is no advance knowledge of how long the repeating part is... Which could mean you consume lots of resources (time, disk space, ...) Producing lots of digits before exhausting resources.

By contrast, your solution using multiplicative order starts by working out how many recurring digits there will be...providing the opportunity to just return NaN before exhausting resources.

By the way, do you think adding a final underscore to numbers would be a useful formatting improvement? It is clear that 1.2_34_ has 34 as the repeating part, whereas 1.2_34 leaves room for doubt as to whether the number has exceeded the size of a page.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Repeating Decimals - lrdheat - 01-13-2018, 12:22 AM
RE: Repeating Decimals - lrdheat - 01-13-2018, 12:23 AM
RE: Repeating Decimals - salvomic - 01-13-2018, 10:06 AM
RE: Repeating Decimals - lrdheat - 01-13-2018, 06:09 PM
RE: Repeating Decimals - Joe Horn - 01-17-2018, 06:20 AM
RE: Repeating Decimals - lrdheat - 01-18-2018, 05:46 AM
RE: Repeating Decimals - Joe Horn - 01-19-2018, 03:58 AM
RE: Repeating Decimals - lrdheat - 01-19-2018, 03:11 PM
RE: Repeating Decimals - Joe Horn - 01-20-2018, 06:02 AM
RE: Repeating Decimals - StephenG1CMZ - 01-20-2018, 09:08 AM
RE: Repeating Decimals - StephenG1CMZ - 01-21-2018, 11:34 AM
RE: Repeating Decimals - StephenG1CMZ - 01-21-2018 10:22 PM
RE: Repeating Decimals - Joe Horn - 01-21-2018, 10:41 PM
RE: Repeating Decimals - StephenG1CMZ - 01-21-2018, 10:58 PM
RE: Repeating Decimals - Joe Horn - 01-22-2018, 01:35 AM
RE: Repeating Decimals - tgray - 01-23-2018, 01:46 AM
RE: Repeating Decimals - Joe Horn - 01-23-2018, 02:18 AM
RE: Repeating Decimals - tgray - 01-23-2018, 02:24 AM
RE: Repeating Decimals - lrdheat - 01-27-2018, 09:53 PM
RE: Repeating Decimals - StephenG1CMZ - 02-05-2018, 11:34 PM
RE: Repeating Decimals - StephenG1CMZ - 02-06-2018, 11:34 PM



User(s) browsing this thread: 1 Guest(s)