Algorithm for converting fraction into (recurring) decimal I need to determine whether fraction is recurring decimal or not (what are conditions for it?), find period and output it as 1/3=0.3. If it is not recurring, then I already have algorithm.

Faith Welch

Faith Welch

Answered question

2022-07-23

Algorithm for converting fraction into (recurring) decimal
I need to determine whether fraction is recurring decimal or not (what are conditions for it?), find period and output it as 1 3 = 0. 3 ¯
If it is not recurring, then I already have algorithm.

Answer & Explanation

phinny5608tt

phinny5608tt

Beginner2022-07-24Added 17 answers

Notice that if you have a repeating decimal
n = 0. D 1 D 2 . . . D k ¯
where each D i is a digit, you can say that
10 k n = D 1 D 2 . . . D k . D 1 D 2 . . . D k ¯
and so
10 k n n = D 1 D 2 . . . D k
and
n = D 1 D 2 . . . D k 10 k 1
This means that n can only be a repeating decimal if n can be expressed in the form
n = a 10 b 1
and so if you are given a number in the form
I + h j
Where I is an integer and j > h, then it can only be a repeating decimal if j evenly divides 10 k 1 for some k. For example, for j = 1 , 2 , 5 , 10 it will never be a repeating decimal.
Does this help?

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?