diff options
author | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-11-21 15:21:33 +0000 |
---|---|---|
committer | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-11-21 15:21:33 +0000 |
commit | ebb0a24940eb551ce03eb361910c423fee7d6499 (patch) | |
tree | 46fccc5920d05d93d00ecd30aff4a012adba3d13 /out_str.c | |
parent | 1cc85c4f5a5658c530891f7348c153155b6dddbb (diff) | |
download | mpfr-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 */ |