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 /awk.h | |
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 'awk.h')
-rw-r--r-- | awk.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1060,6 +1060,8 @@ enum block_id { BLOCK_INVALID = 0, /* not legal */ BLOCK_NODE, BLOCK_BUCKET, + BLOCK_MPFR, + BLOCK_MPZ, BLOCK_MAX /* count */ }; @@ -1945,3 +1947,18 @@ erealloc_real(void *ptr, size_t count, const char *where, const char *var, const return ret; } + +static inline NODE * +make_number_node(unsigned int tp) +{ + NODE *r; + getnode(r); + r->type = Node_val; + r->valref = 1; + r->flags = (tp|MALLOC|NUMBER|NUMCUR); + r->stptr = NULL; + r->stlen = 0; + r->wstptr = NULL; + r->wstlen = 0; + return r; +} |