Sujet : Re: Bignum multiplication in Python vs GMP (was: constexpr is really very smart!)
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.c++Date : 27. Dec 2024, 03:54:59
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86ed1tded8.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Michael S <
already5chosen@yahoo.com> writes:
[GMP in python?]
>
Forgot to mention.
As said in the same redit thread, one can use GMP from python. It's
pretty easy, just not the default.
>
[example]
Thank you, that is good to know.
For big values of n gmpy2-based variant calculates Fibbonaci numbers at
approximately the same speed as C variant. For smaller numbers - not
quite the same as C and for n < ~10,000 it is slower than default
python math.
So now we need a hybrid method where "small" numbers use default
python algorithms and advance to GMP for larger numbers, with each
of those two already being hybrids? A hybrid**2 algorithm? I like
it. ;)
By the way, in the last week or so I sent you two emails. Could I
ask you to send a short email in response (assuming they arrived,
which I expect they did)?