Sujet : Re: Prog Challenge
De : Physfitfreak (at) *nospam* gmail.com (Physfitfreak)
Groupes : comp.os.linux.advocacyDate : 08. Mar 2024, 05:25:17
Autres entêtes
Message-ID : <use0es$12qgm$1@solani.org>
References : 1
User-Agent : Mozilla Thunderbird
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)
-- This email has been checked for viruses by Avast antivirus software.www.avast.com