aboutsummaryrefslogtreecommitdiffstats
path: root/mpfr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mpfr.c b/mpfr.c
index 0c962c67..b6e9c16e 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -357,6 +357,11 @@ mpg_format_val(const char *format, int index, NODE *s)
NODE *dummy[2], *r;
unsigned int oflags;
+ if (out_of_range(s)) {
+ const char *result = format_nan_inf(s, 'g');
+ return make_string(result, strlen(result));
+ }
+
/* create dummy node for a sole use of format_tree */
dummy[1] = s;
oflags = s->flags;