mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py: Added optimised support for 3-argument calls to builtin.pow()
Updated modbuiltin.c to add conditional support for 3-arg calls to pow() using MICROPY_PY_BUILTINS_POW3 config parameter. Added support in objint_mpz.c for for optimised implementation.
This commit is contained in:
committed by
Paul Sokolovsky
parent
2486c4ff46
commit
df0117c8ae
6
py/mpz.c
6
py/mpz.c
@@ -1395,9 +1395,6 @@ void mpz_pow_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
|
||||
mpz_free(n);
|
||||
}
|
||||
|
||||
#if 0
|
||||
these functions are unused
|
||||
|
||||
/* computes dest = (lhs ** rhs) % mod
|
||||
can have dest, lhs, rhs the same; mod can't be the same as dest
|
||||
*/
|
||||
@@ -1436,6 +1433,9 @@ void mpz_pow3_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs, const mpz_t
|
||||
mpz_free(n);
|
||||
}
|
||||
|
||||
#if 0
|
||||
these functions are unused
|
||||
|
||||
/* computes gcd(z1, z2)
|
||||
based on Knuth's modified gcd algorithm (I think?)
|
||||
gcd(z1, z2) >= 0
|
||||
|
||||
Reference in New Issue
Block a user