From eb520f74a818e381004bd69668d7ba1abb94a0bb Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 6 Sep 2013 12:28:21 +0100 Subject: [PATCH] Fix sb-gmp:mpz-pow for non-bignum bases Don't declare types, and we don't need the check-type either --- contrib/sb-gmp/gmp.lisp | 3 --- 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 3dfefd6..283db5a 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 4555a1d..ee3b627 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)) -- 1.7.10.4