Sujet : Re: Prog Challenge
De : nuxxie (at) *nospam* linux.rocks (Nuxxie)
Groupes : comp.os.linux.advocacyDate : 08. Mar 2024, 16:54:29
Autres entêtes
Organisation : UsenetExpress - www.usenetexpress.com
Message-ID : <17bad1c8e19520b7$8$821545$802601b3@news.usenetexpress.com>
References : 1 2 3
User-Agent : Pan/0.146 (Hic habitat felicitas; d7a48b4 gitlab.gnome.org/GNOME/pan.git)
On Fri, 08 Mar 2024 14:20:12 +0000, Nuxxie wrote:
But it fails for 1/28:
zn_order(10,28);
false
I found out the problem here.
The denominator, d, has to be factored as 2^i * 5^j * d', where
possibly i=1 and j=1.
In this case, 28 = 2^2 * 7 (i.e. i=2, j=0)
Now, zn_order(10,7) = 6
Thus 1/28 has a repeating portion of length 6 which is preceeded
by max(i,j) = 2 digits:
1/28 = 0.03571428571428...
This is fantastic stuff!
My main source, so far, is this link:
https://math.stackexchange.com/questions/377683/length-of-period-of-decimal-expansion-of-a-fraction
Maxima uses multi-precision, based on GMP, and can handle extremely
large decimal expansions.