summaryrefslogtreecommitdiff
path: root/out_str.c
diff options
context:
space:
mode:
authorhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-11-21 15:21:33 +0000
committerhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-11-21 15:21:33 +0000
commitebb0a24940eb551ce03eb361910c423fee7d6499 (patch)
tree46fccc5920d05d93d00ecd30aff4a012adba3d13 /out_str.c
parent1cc85c4f5a5658c530891f7348c153155b6dddbb (diff)
downloadmpfr-ebb0a24940eb551ce03eb361910c423fee7d6499.tar.gz
Infinis, premiere tentative.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@793 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'out_str.c')
-rw-r--r--out_str.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/out_str.c b/out_str.c
index 04ea9d724..468a850dd 100644
--- a/out_str.c
+++ b/out_str.c
@@ -42,8 +42,14 @@ mpfr_out_str (stream, base, n_digits, op, rnd_mode)
if (MPFR_IS_NAN(op)) { fprintf(stream, "NaN"); return 3; }
if (!MPFR_NOTZERO(op)) { fprintf(stream, "0"); return 1; }
+ if (MPFR_IS_INF(op))
+ {
+ if (MPFR_SIGN(op) == 1) { fprintf(stream, "Inf"); return 3; }
+ else { fprintf(stream, "-Inf"); return 4; }
+ }
s = mpfr_get_str(NULL, &e, base, n_digits, op, rnd_mode);
+ /* TODO: maintenir le code pour les infinis dans get_str ? */
s0 = s;
/* for op=3.1416 we have s = "31416" and e = 1 */