summaryrefslogtreecommitdiff
path: root/printf
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gmplib.org>2009-09-15 20:28:32 +0200
committerTorbjorn Granlund <tege@gmplib.org>2009-09-15 20:28:32 +0200
commit749bd2c424df58f444e9c59c250a7140e3168c18 (patch)
treefee30e59c62df5751d304a9e62b5db5bbe3edef1 /printf
parente9ca597fb6ad657164c9586217e644c22057e99a (diff)
downloadgmp-749bd2c424df58f444e9c59c250a7140e3168c18.tar.gz
Print huge exponents properly.
Diffstat (limited to 'printf')
-rw-r--r--printf/doprnt.c10
-rw-r--r--printf/doprntf.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/printf/doprnt.c b/printf/doprnt.c
index a6e8c082e..c1ee0a2ae 100644
--- a/printf/doprnt.c
+++ b/printf/doprnt.c
@@ -211,7 +211,7 @@ __gmp_doprnt (const struct doprnt_funs_t *funs, void *data,
param.base = 10;
param.conv = 0;
- param.expfmt = "e%c%02d";
+ param.expfmt = "e%c%02ld";
param.exptimes4 = 0;
param.fill = ' ';
param.justify = DOPRNT_JUSTIFY_RIGHT;
@@ -239,11 +239,11 @@ __gmp_doprnt (const struct doprnt_funs_t *funs, void *data,
and there's no leading zeros on the exponent (which is in
fact bit-based) */
param.base = 16;
- param.expfmt = "p%c%d";
+ param.expfmt = "p%c%ld";
goto conv_a;
case 'A':
param.base = -16;
- param.expfmt = "P%c%d";
+ param.expfmt = "P%c%ld";
conv_a:
param.conv = DOPRNT_CONV_SCIENTIFIC;
param.exptimes4 = 1;
@@ -350,7 +350,7 @@ __gmp_doprnt (const struct doprnt_funs_t *funs, void *data,
case 'E':
param.base = -10;
- param.expfmt = "E%c%02d";
+ param.expfmt = "E%c%02ld";
/*FALLTHRU*/
case 'e':
param.conv = DOPRNT_CONV_SCIENTIFIC;
@@ -403,7 +403,7 @@ __gmp_doprnt (const struct doprnt_funs_t *funs, void *data,
case 'G':
param.base = -10;
- param.expfmt = "E%c%02d";
+ param.expfmt = "E%c%02ld";
/*FALLTHRU*/
case 'g':
param.conv = DOPRNT_CONV_GENERAL;
diff --git a/printf/doprntf.c b/printf/doprntf.c
index 15419dd1e..db7fd2e59 100644
--- a/printf/doprntf.c
+++ b/printf/doprntf.c
@@ -231,7 +231,7 @@ __gmp_doprnt_mpf (const struct doprnt_funs_t *funs,
case DOPRNT_CONV_SCIENTIFIC:
{
- int expval;
+ long int expval;
char expsign;
if (prec <= -1)