summaryrefslogtreecommitdiff
path: root/mpfr.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-04-16 11:04:29 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-04-16 11:04:29 +0300
commit67f4d070335e12622af1363b71c68489c64f5bc7 (patch)
tree32f09ad1bcce8d17b4ac036e01158f1f64da971d /mpfr.c
parent0813c48d190d983cb0b3e55f5d8345c91c43e09b (diff)
downloadgawk-67f4d070335e12622af1363b71c68489c64f5bc7.tar.gz
Fixes for intdiv function, including documentation.
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mpfr.c b/mpfr.c
index 5a2a35d3..c83a57b3 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -1224,7 +1224,9 @@ do_mpfr_intdiv(int nargs)
} else {
if (! mpfr_number_p(numerator->mpg_numbr)) {
/* [+-]inf or NaN */
- return numerator;
+ unref(numerator);
+ unref(denominator);
+ return make_number((AWKNUM) -1);
}
num = mpg_integer();
@@ -1237,7 +1239,10 @@ do_mpfr_intdiv(int nargs)
} else {
if (! mpfr_number_p(denominator->mpg_numbr)) {
/* [+-]inf or NaN */
- return denominator;
+ unref(numerator);
+ unref(denominator);
+ unref(num);
+ return make_number((AWKNUM) -1);
}
denom = mpg_integer();