diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-01-28 21:51:58 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-01-28 21:51:58 +0200 |
commit | 4d691ab28f594c2a85f5e5c6c5d93eb168fade70 (patch) | |
tree | 46f396f53e90eaaca87c7859f4134bc832a2e391 /awkgram.c | |
parent | 3f8c0c06075b331d9f305f475f20e99c96fba95c (diff) | |
parent | ab8d7416c064c94e75d80431270321ceaa866719 (diff) | |
download | egawk-4d691ab28f594c2a85f5e5c6c5d93eb168fade70.tar.gz egawk-4d691ab28f594c2a85f5e5c6c5d93eb168fade70.tar.bz2 egawk-4d691ab28f594c2a85f5e5c6c5d93eb168fade70.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -4514,10 +4514,13 @@ negate_num(NODE *n) { int tval = 0; - if (! is_mpg_number(n)) + if (! is_mpg_number(n)) { n->numbr = -n->numbr; + return; + } + #ifdef HAVE_MPFR - else if (is_mpg_integer(n)) { + if (is_mpg_integer(n)) { if (! iszero(n)) { mpz_neg(n->mpg_i, n->mpg_i); return; @@ -4526,9 +4529,11 @@ negate_num(NODE *n) /* * 0 --> -0 conversion. Requires turning the MPG integer * into an MPFR float. - * - * So, convert and fall through. */ + + mpz_clear(n->mpg_i); /* release the integer storage */ + + /* Convert and fall through. */ tval = mpfr_set_d(n->mpg_numbr, 0.0, ROUND_MODE); IEEE_FMT(n->mpg_numbr, tval); n->flags &= ~MPZN; |