summaryrefslogtreecommitdiff
path: root/mpf/out_str.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2002-01-15 01:21:21 +0100
committerKevin Ryde <user42@zip.com.au>2002-01-15 01:21:21 +0100
commit13d6ac68914adace11ba9adf81f91051ee0e9114 (patch)
tree97822a719cfc6a157460bc4c45323ee3b309b1a1 /mpf/out_str.c
parente0a7fb4a9c189b1222804a8314ef45d0df09973a (diff)
downloadgmp-13d6ac68914adace11ba9adf81f91051ee0e9114.tar.gz
* mpf/out_str.c: Use MPF_SIGNIFICANT_DIGITS, so mpf_out_str and
mpf_get_str give the same for ndigits==0.
Diffstat (limited to 'mpf/out_str.c')
-rw-r--r--mpf/out_str.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mpf/out_str.c b/mpf/out_str.c
index 156399fbe..e49982913 100644
--- a/mpf/out_str.c
+++ b/mpf/out_str.c
@@ -2,7 +2,7 @@
the float OP to STREAM in base BASE. Return the number of characters
written, or 0 if an error occurred.
-Copyright 1996, 1997, 2001 Free Software Foundation, Inc.
+Copyright 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -46,8 +46,7 @@ mpf_out_str (FILE *stream, int base, size_t n_digits, mpf_srcptr op)
if (base == 0)
base = 10;
if (n_digits == 0)
- n_digits = (((op->_mp_prec - 1) * BITS_PER_MP_LIMB)
- * __mp_bases[base].chars_per_bit_exactly);
+ MPF_SIGNIFICANT_DIGITS (n_digits, base, op->_mp_prec);
if (stream == 0)
stream = stdout;