c# - How to calculate the infinite value of a division? -


possible duplicate:
how know repeating decimal in fraction?

1/3 different 3/10. 0.33333 != 0.3

so 1/3 0.3 (with line above number three)

1/12 = 0.833333 = 0.083 (with line above number three)

1/13 = 0.076923076923 = 0.|076923|

those lines represent repeating part.

i plan have model in class. i'm bit lost on situation. need ideas know determine repeating value. thanks.

cycle detection algorithm answer. can use floyd's cycle detection algorithm or brent's cycle detection algorithm.

the function plug algorithms function produce next digit of quotient.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -