aboutsummaryrefslogtreecommitdiff
path: root/py/mpz.c
diff options
context:
space:
mode:
authorNicko van Someren <nicko@nicko.org>2017-02-01 16:41:22 -0700
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-02-02 22:23:10 +0300
commitdf0117c8ae213a0652c3b19a969edc7fd994eeab (patch)
tree015d209752d8277e9bcd970b10a08556f438b386 /py/mpz.c
parent2486c4ff469fdb69555476e342eadda91a4ceadf (diff)
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.
Diffstat (limited to 'py/mpz.c')
-rw-r--r--py/mpz.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/mpz.c b/py/mpz.c
index 6477c3f8d..230eb921c 100644
--- a/py/mpz.c
+++ b/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