Post Reply 
Repeating Decimals
01-23-2018, 02:18 AM (This post was last modified: 01-23-2018 02:28 AM by Joe Horn.)
Post: #17
RE: Repeating Decimals
(01-23-2018 01:46 AM)tgray Wrote:  Cool post. I learned something. I also implemented Joe's method for the DM42/Free42: link

I did notice that Joe's algorithm misses the first repeating period of 11632/864.

It doesn't. See below.

Quote:I think this is because when you factor 864 for factors of 2 and 5, you get 2^5 for the 2's.

But you shouldn't factor 864, because your input (11632/864) reduces to 727/54. If your program inputs the numerator and denominator separately, then YOU must reduce them yourself before doing anything else. The work for your example is therefore done on 54, not 864.

EDIT: Aha! I just noticed that my algorithm posting above doesn't mention that the input fraction must be fully reduced. If I may offer a feeble (but true) excuse, it's because I think in RPL, and when you put a fraction on an RPL stack, it automatically gets reduced, so I assumed that the input would always already be reduced. This of course is not the case for program which input the numerator and denominator separately. I will edit the algorithm posting above to insert STEP ZERO: Fully reduce the fraction. Wink

Quote:So following the method, there are 5 non repeating digits after the decimal, even though there are actually only 2, with the next 3 being the first period of the repeating set of 3 digits. I didn't attempt to fix this.

11632/864 -> 13.46_296...

11632/864 = 727/54, and 54 = 2^1 * 3^3. Therefore there is actually only ONE non-repeating digit: "13.4_629_".

<0|ΙΈ|0>
-Joe-
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: 2 Guest(s)