diff options
author | tege <tege@gmplib.org> | 2002-05-09 00:51:04 +0200 |
---|---|---|
committer | tege <tege@gmplib.org> | 2002-05-09 00:51:04 +0200 |
commit | 26d1435e00d5ea89288c946cb1ccfeab4e1f729a (patch) | |
tree | 5b368da8b3966b10b0c236df461e6772867b03cf | |
parent | a83fdb8eeaef6a5dff2628da16aa41707568a048 (diff) | |
download | gmp-26d1435e00d5ea89288c946cb1ccfeab4e1f729a.tar.gz |
Don't allocate extra limb for root value.
-rw-r--r-- | mpz/root.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mpz/root.c b/mpz/root.c index 677ac5bad..87c921ebd 100644 --- a/mpz/root.c +++ b/mpz/root.c @@ -69,12 +69,12 @@ mpz_root (mpz_ptr r, mpz_srcptr u, unsigned long int nth) if (r != NULL) { - rootp = MPZ_REALLOC (r, rootn + 1); + rootp = MPZ_REALLOC (r, rootn); up = PTR(u); } else { - rootp = __GMP_ALLOCATE_FUNC_LIMBS (rootn + 1); + rootp = __GMP_ALLOCATE_FUNC_LIMBS (rootn); } if (nth == 1) @@ -90,7 +90,7 @@ mpz_root (mpz_ptr r, mpz_srcptr u, unsigned long int nth) if (r != NULL) SIZ(r) = us >= 0 ? rootn : -rootn; else - __GMP_FREE_FUNC_LIMBS (rootp, rootn + 1); + __GMP_FREE_FUNC_LIMBS (rootp, rootn); return exact; } |