aboutsummaryrefslogtreecommitdiffstats
path: root/mpfr.c
diff options
context:
space:
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: