summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2004-10-25 19:00:56 +0200
committertege <tege@gmplib.org>2004-10-25 19:00:56 +0200
commit1f3fa7fa2d9c818aeae67f338faeb7b61e9ad097 (patch)
treea54161dab9c25b77a87ad67ad497f8e292a5a2c8
parent1f8b9a5e6765fa2272ebde53c6106feadc513f48 (diff)
downloadgmp-1f3fa7fa2d9c818aeae67f338faeb7b61e9ad097.tar.gz
(main): Handle "negative" base in mpz_sizeinbase call.
-rw-r--r--demos/pexpr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/demos/pexpr.c b/demos/pexpr.c
index d03d5ce39..5e863342f 100644
--- a/demos/pexpr.c
+++ b/demos/pexpr.c
@@ -469,7 +469,8 @@ main (int argc, char **argv)
else
{
printf ("result is approximately %ld digits%s\n",
- (long) mpz_sizeinbase (r, 10), newline);
+ (long) mpz_sizeinbase (r, base >= 0 ? base : -base),
+ newline);
}
free_expr (e);