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 2022-07-23 Answered
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.
You can still ask an expert for help

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question

Answers (1)

phinny5608tt
Answered 2022-07-24 Author has 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?
Not exactly what you’re looking for?
Ask My Question

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

New questions