summaryrefslogtreecommitdiff
path: root/out_str.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-03-06 16:41:25 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-03-06 16:41:25 +0000
commitaa4b6be80ba9aa43b7bb82ca8d53cf7b41048169 (patch)
tree363c376299036e4a52679d49bab7511e94f52153 /out_str.c
parent7917dbcad1907af9d28894b90f525879eeb2b5fb (diff)
downloadmpfr-aa4b6be80ba9aa43b7bb82ca8d53cf7b41048169.tar.gz
fixed bug for Infinity (was testing zero before)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1014 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'out_str.c')
-rw-r--r--out_str.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/out_str.c b/out_str.c
index 95c2ac930..c02129efe 100644
--- a/out_str.c
+++ b/out_str.c
@@ -43,12 +43,30 @@ mpfr_out_str (stream, base, n_digits, op, rnd_mode)
size_t l;
mp_exp_t e;
- if (MPFR_IS_NAN(op)) { fprintf(stream, "NaN"); return 3; }
- if (!MPFR_NOTZERO(op)) { fprintf(stream, "0"); return 1; }
+ if (MPFR_IS_NAN(op))
+ {
+ fprintf (stream, "NaN");
+ return 3;
+ }
+
if (MPFR_IS_INF(op))
{
- if (MPFR_SIGN(op) == 1) { fprintf(stream, "Inf"); return 3; }
- else { fprintf(stream, "-Inf"); return 4; }
+ if (MPFR_SIGN(op) == 1)
+ {
+ fprintf (stream, "Inf");
+ return 3;
+ }
+ else
+ {
+ fprintf (stream, "-Inf");
+ return 4;
+ }
+ }
+
+ if (!MPFR_NOTZERO(op))
+ {
+ fprintf(stream, "0");
+ return 1;
}
s = mpfr_get_str (NULL, &e, base, n_digits, op, rnd_mode);