diff options
Diffstat (limited to 'mpfr.c')
-rw-r--r-- | mpfr.c | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -103,28 +103,16 @@ cleanup_mpfr(void) /* mpg_node --- allocate a node to store MPFR float or GMP integer */ NODE * -mpg_node(unsigned int tp) +mpg_node(unsigned int flags) { - NODE *r; - getnode(r); - r->type = Node_val; + NODE *r = make_number_node(flags); - if (tp == MPFN) { + if (flags == MPFN) /* Initialize, set precision to the default precision, and value to NaN */ mpfr_init(r->mpg_numbr); - r->flags = MPFN; - } else { + else /* Initialize and set value to 0 */ mpz_init(r->mpg_i); - r->flags = MPZN; - } - - r->valref = 1; - r->flags |= MALLOC|NUMBER|NUMCUR; - r->stptr = NULL; - r->stlen = 0; - r->wstptr = NULL; - r->wstlen = 0; return r; } |