summaryrefslogtreecommitdiff
path: root/mpfr.h
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-21 17:06:15 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-21 17:06:15 +0000
commitc7425182d97fbecd829b268835a9fe489321d2e6 (patch)
tree55557bf4c59b7ca75626eb3ba95110e0ac763fb1 /mpfr.h
parente8473281af173f200ff3d3b1faacdb12da1834eb (diff)
downloadmpfr-c7425182d97fbecd829b268835a9fe489321d2e6.tar.gz
added MPFR_SIGN
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@923 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'mpfr.h')
-rw-r--r--mpfr.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/mpfr.h b/mpfr.h
index 1211f78a1..16e331163 100644
--- a/mpfr.h
+++ b/mpfr.h
@@ -67,6 +67,8 @@ typedef __mpfr_struct mpfr_t[1];
typedef __mpfr_struct *mpfr_ptr;
typedef __gmp_const __mpfr_struct *mpfr_srcptr;
+#define MPFR_SIGN(x) (((x)->_mpfr_size >> 31) ? -1 : 1)
+
/* Prototypes */
#ifndef _PROTO
@@ -156,11 +158,11 @@ void mpfr_dump _PROTO((mpfr_srcptr, mp_rnd_t));
}
#endif
-#define mpfr_cmp_ui(b,i) mpfr_cmp_ui_2exp(b,i,0)
-#define mpfr_cmp_si(b,i) mpfr_cmp_si_2exp(b,i,0)
+#define mpfr_cmp_ui(b,i) mpfr_cmp_ui_2exp((b),(i),0)
+#define mpfr_cmp_si(b,i) mpfr_cmp_si_2exp((b),(i),0)
#define mpfr_set(a,b,r) mpfr_set4(a,b,r,MPFR_SIGN(b))
#define mpfr_abs(a,b,r) mpfr_set4(a,b,r,1)
-#define mpfr_cmp(b,c) mpfr_cmp3(b,c,1)
+#define mpfr_cmp(b, c) mpfr_cmp3(b, c, 1)
#define mpfr_init_set_si(x, i, rnd) \
do { mpfr_init(x); mpfr_set_si((x), (i), (rnd)); } while (0)