diff options
author | Christophe Rhodes <c.rhodes@gold.ac.uk> | 2013-09-06 12:28:21 +0100 |
---|---|---|
committer | Christophe Rhodes <c.rhodes@gold.ac.uk> | 2013-09-06 12:28:21 +0100 |
commit | eb520f74a818e381004bd69668d7ba1abb94a0bb (patch) | |
tree | 374cbbf9dd0a80bc89acc904200cec5c0d481c69 /contrib/sb-gmp | |
parent | 7a2ee8c1aff0bdd286cf5d43ab40bff7fed86bea (diff) |
Fix sb-gmp:mpz-pow for non-bignum bases
Don't declare types, and we don't need the check-type either
Diffstat (limited to 'contrib/sb-gmp')
-rw-r--r-- | contrib/sb-gmp/gmp.lisp | 3 | ||||
-rw-r--r-- | contrib/sb-gmp/tests.lisp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/contrib/sb-gmp/gmp.lisp b/contrib/sb-gmp/gmp.lisp index 3dfefd6b8..283db5a49 100644 --- a/contrib/sb-gmp/gmp.lisp +++ b/contrib/sb-gmp/gmp.lisp @@ -449,9 +449,6 @@ be (1+ COUNT)." (__gmpz_tdiv_qr (addr quot) (addr rem) (addr gn) (addr gd)))))) (defun mpz-pow (base exp) - (declare (optimize (speed 3) (space 3) (safety 0)) - (type bignum-type base)) - (check-type exp (unsigned-byte #.sb-vm:n-word-bits)) (with-gmp-mpz-results (rop) (with-mpz-vars ((base gbase)) (__gmpz_pow_ui (addr rop) (addr gbase) exp)))) diff --git a/contrib/sb-gmp/tests.lisp b/contrib/sb-gmp/tests.lisp index 4555a1df7..ee3b6270d 100644 --- a/contrib/sb-gmp/tests.lisp +++ b/contrib/sb-gmp/tests.lisp @@ -195,3 +195,7 @@ (test-n-cases '/ 'mpq-div (gen-mpq :limbs limbs :sign t) (gen-mpq :limbs limbs :sign t))) + +(define-gmp-test (pow) + (test-one-case 'expt 'mpz-pow + 16 3)) |