summaryrefslogtreecommitdiff
path: root/mpfr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mpfr.c b/mpfr.c
index 6afa8c65..40833124 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -349,6 +349,15 @@ mpg_force_number(NODE *n)
{
char *cp, *cpend;
+ if (n->type == Node_elem_new) {
+ n->type = Node_val;
+ n->flags &= ~STRING;
+ n->stptr[0] = '0'; // STRCUR is still set
+ n->stlen = 1;
+
+ return n;
+ }
+
if ((n->flags & NUMCUR) != 0)
return n;
n->flags |= NUMCUR;