summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2002-02-17 21:56:06 +0100
committertege <tege@gmplib.org>2002-02-17 21:56:06 +0100
commit123d4eefd8f8bc198ac9d937a6a64ccfe2a4c653 (patch)
tree649ddd7bf8e36d649598a77c0c681470be64256f /demos
parente382edbdf8781be69f557191c3bc6ea27ce9915f (diff)
downloadgmp-123d4eefd8f8bc198ac9d937a6a64ccfe2a4c653.tar.gz
Support `-X' for upper case hex, make `-x' output lower case hex.
Diffstat (limited to 'demos')
-rw-r--r--demos/pexpr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/demos/pexpr.c b/demos/pexpr.c
index f20516505..aaa1b6c72 100644
--- a/demos/pexpr.c
+++ b/demos/pexpr.c
@@ -293,6 +293,8 @@ main (int argc, char **argv)
base = 2;
else if (arg[1] == 'x' && arg[2] == 0)
base = 16;
+ else if (arg[1] == 'X' && arg[2] == 0)
+ base = -16;
else if (arg[1] == 'o' && arg[2] == 0)
base = 8;
else if (arg[1] == 'd' && arg[2] == 0)
@@ -412,11 +414,11 @@ main (int argc, char **argv)
{
double t;
printf ("output conversion ");
- TIME (t, mpz_get_str (tmp, -base, r));
+ TIME (t, mpz_get_str (tmp, base, r));
printf ("took %.2f ms%s\n", t, newline);
}
else
- mpz_get_str (tmp, -base, r);
+ mpz_get_str (tmp, base, r);
out_len = strlen (tmp);
if (flag_splitup_output)