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

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -