aboutsummaryrefslogtreecommitdiffstats
path: root/mpfr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/mpfr.c b/mpfr.c
index c0f1ff0c..4b875668 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -105,26 +105,14 @@ cleanup_mpfr(void)
NODE *
mpg_node(unsigned int tp)
{
- NODE *r;
- getnode(r);
- r->type = Node_val;
+ NODE *r = make_number_node(tp);
- if (tp == MPFN) {
+ if (tp == 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;
}