summaryrefslogtreecommitdiff
path: root/mpfr.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2018-02-07 14:16:47 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2018-02-07 14:16:47 -0500
commitf9ff7769b7b38973bf7447b8ca596435ccf77b67 (patch)
tree28313e5d0755e3e10c10619edcc660202a0dd8fe /mpfr.c
parent9b4b32b5911b9d51643d2efd6c646f17e5214c03 (diff)
downloadgawk-f9ff7769b7b38973bf7447b8ca596435ccf77b67.tar.gz
Fix bug printing +"01" in regular and MPFR mode.
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mpfr.c b/mpfr.c
index 1c4a2b9b..0c962c67 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -1682,6 +1682,20 @@ mod:
REPLACE(r);
break;
+ case Op_unary_plus:
+ t1 = TOP_NUMBER();
+ if (is_mpg_float(t1)) {
+ r = mpg_float();
+ tval = mpfr_set(r->mpg_numbr, t1->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ } else {
+ r = mpg_integer();
+ mpz_set(r->mpg_i, t1->mpg_i);
+ }
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
case Op_assign_plus:
case Op_assign_minus:
case Op_assign_times: