diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2017-01-06 14:48:53 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2017-01-06 14:48:53 -0500 |
commit | 9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba (patch) | |
tree | 7b5339408b9770e2db7483eda61af2166635e912 /mpfr.c | |
parent | 0cb66f4f80cc8c2df63aed30e2cf5753a106b951 (diff) | |
download | egawk-9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba.tar.gz egawk-9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba.tar.bz2 egawk-9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba.zip |
Enhance API to support extended-precision arithmetic and implement intdiv as a demonstration.
Diffstat (limited to 'mpfr.c')
-rw-r--r-- | mpfr.c | 18 |
1 files changed, 3 insertions, 15 deletions
@@ -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; } |