Sujet : Re: Prog Challenge
De : nospam (at) *nospam* dfs.com (DFS)
Groupes : comp.os.linux.advocacyDate : 08. Mar 2024, 22:35:56
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <usfsrc$1svs6$2@dont-email.me>
References : 1 2
User-Agent : Betterbird (Windows)
On 3/7/2024 10:25 PM, Physfitfreak wrote:
On 3/7/2024 12:11 PM, Nuxxie wrote:
Programming is about mathematics and not coding.
>
Problem:
>
Any rational number a/b (in lowest terms) can be expressed either
as a terminating decimal or a repeating decimal.
>
We consider here only repeating decimals.
>
Given, a and b, which are intergers with any number of digits,
find the repeating portion in the decimal expansion.
>
That is, the decimal expansion will be:
>
a1, a2, a3, ... an, [r1, r2, r3 ... rn]
>
where [... ri ...] is the repeating portion.
>
Example:
>
1/28 = 0.03 571428 571428...
>
The non-repeating, leading portion can be very long and so too can
the repeating portion.
>
I don't think the dorks here know such stuff. And the good ones believe it's waste of time but what they do (i.e. "fart") is not waste of time.
So I'll go ahead and ruin it for them all :)
(method of nines)
Ruin away, Sandy. You 2 neurotics are the only ones who care about such nonsense anyway.