diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-03-09 15:18:17 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-03-09 15:18:17 +0000 |
commit | 2c14330c00d8d0f8d347d81d16fcf92e21990787 (patch) | |
tree | 00fff8e6170c584518186912c791cc46d124225c /gmp_op.c | |
parent | 50e4fb6de6c0dd8f0ff3eeaf2db0e28ec7e81cc0 (diff) | |
download | mpfr-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.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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; +} |