summaryrefslogtreecommitdiff
path: root/cxx
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-10-24 02:26:36 +0200
committerKevin Ryde <user42@zip.com.au>2001-10-24 02:26:36 +0200
commitaf0b9462bb3e4d15a78128fc7c6c1a8d29cd3c6a (patch)
tree714968fcc044b470410b14bd6214812d360e41b2 /cxx
parent98ea84192eb3b3bf379decb6126e753fd1a89fe2 (diff)
downloadgmp-af0b9462bb3e4d15a78128fc7c6c1a8d29cd3c6a.tar.gz
* printf/doprnti.c: Use the precision field to print leading zeros.
* cxx/osdoprnti.cc, gmp-impl.h: Ignore precision in operator<<.
Diffstat (limited to 'cxx')
-rw-r--r--cxx/osdoprnti.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/cxx/osdoprnti.cc b/cxx/osdoprnti.cc
index d014a3042..e762d4e37 100644
--- a/cxx/osdoprnti.cc
+++ b/cxx/osdoprnti.cc
@@ -36,17 +36,20 @@ using namespace std;
/* The gmp_asprintf support routines never give an error, so
- __gmp_doprnt_mpf shouldn't fail and it's return can just be checked with
- an ASSERT. */
+ __gmp_doprnt_integer shouldn't fail and it's return can just be checked
+ with an ASSERT. */
ostream&
-__gmp_doprnt_integer_ostream (ostream &o, const struct doprnt_params_t *p,
+__gmp_doprnt_integer_ostream (ostream &o, struct doprnt_params_t *p,
char *s)
{
struct gmp_asprintf_t d;
char *result;
int ret;
+ /* don't show leading zeros the way printf does */
+ p->prec = -1;
+
GMP_ASPRINTF_T_INIT (d, &result);
ret = __gmp_doprnt_integer (&__gmp_asprintf_funs_noformat, &d, p, s);
ASSERT (ret != -1);