summaryrefslogtreecommitdiff
path: root/neg.c
diff options
context:
space:
mode:
Diffstat (limited to 'neg.c')
-rw-r--r--neg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/neg.c b/neg.c
new file mode 100644
index 000000000..6a85f3971
--- /dev/null
+++ b/neg.c
@@ -0,0 +1,13 @@
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "mpfr.h"
+
+void mpfr_neg(mpfr_t a, mpfr_t b, unsigned char rnd_mode)
+{
+ CHANGE_SIGN(b);
+ if (a != b) {
+ mpfr_set(a, b, rnd_mode);
+ CHANGE_SIGN(b);
+ }
+ return;
+}