summaryrefslogtreecommitdiff
path: root/gmp_op.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-03-09 15:18:17 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-03-09 15:18:17 +0000
commit2c14330c00d8d0f8d347d81d16fcf92e21990787 (patch)
tree00fff8e6170c584518186912c791cc46d124225c /gmp_op.c
parent50e4fb6de6c0dd8f0ff3eeaf2db0e28ec7e81cc0 (diff)
downloadmpfr-2c14330c00d8d0f8d347d81d16fcf92e21990787.tar.gz
Add mpfr_cmp_f and its test.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2827 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'gmp_op.c')
-rw-r--r--gmp_op.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gmp_op.c b/gmp_op.c
index a2308a891..7140007a1 100644
--- a/gmp_op.c
+++ b/gmp_op.c
@@ -252,3 +252,17 @@ mpfr_cmp_q (mpfr_srcptr x, mpq_srcptr z)
mpfr_clear (t);
return res;
}
+
+int
+mpfr_cmp_f (mpfr_srcptr x, mpf_srcptr z)
+{
+ mpfr_t t;
+ int res;
+
+ mpfr_init2 (t, MPFR_PREC_MIN + ABS(SIZ(z)) * BITS_PER_MP_LIMB );
+ res = mpfr_set_f (t, z, GMP_RNDN);
+ MPFR_ASSERTD( res == 0 );
+ res = mpfr_cmp (x, t);
+ mpfr_clear (t);
+ return res;
+}