diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-05-24 23:44:24 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-05-24 23:44:24 +0000 |
commit | 9758ac93d8385c73fddb001c9d8b5c3acb3705d2 (patch) | |
tree | 58aeeeca63b374a6cdedadb5c7cd4ebb5d0ab3d7 /tests/tlog_ui.c | |
parent | f261588e5a06864077de05a263a5a5b42e0d2c95 (diff) | |
download | mpfr-9758ac93d8385c73fddb001c9d8b5c3acb3705d2.tar.gz |
[tests/tlog_ui.c] Improved a test function.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10365 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tlog_ui.c')
-rw-r--r-- | tests/tlog_ui.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/tlog_ui.c b/tests/tlog_ui.c index 56ec71289..ca145c27d 100644 --- a/tests/tlog_ui.c +++ b/tests/tlog_ui.c @@ -27,15 +27,19 @@ compare_with_log (unsigned long n, mpfr_prec_t p) { mpfr_t x, y; int inex1, inex2; - mpfr_inits2 (p, x, y, (mpfr_ptr) 0); - mpfr_set_prec (x, sizeof (unsigned long) * CHAR_BIT); + mpfr_flags_t flags1; + + mpfr_init2 (x, sizeof (unsigned long) * CHAR_BIT); + mpfr_init2 (y, p); inex1 = mpfr_set_ui (x, n, MPFR_RNDN); MPFR_ASSERTN(inex1 == 0); inex1 = mpfr_log (y, x, MPFR_RNDN); + flags1 = __gmpfr_flags; mpfr_set_prec (x, p); inex2 = mpfr_log_ui (x, n, MPFR_RNDN); MPFR_ASSERTN(inex1 == inex2); - MPFR_ASSERTN(mpfr_cmp (x, y) == 0); + MPFR_ASSERTN(flags1 == __gmpfr_flags); + MPFR_ASSERTN(mpfr_equal_p (x, y)); mpfr_clears (x, y, (mpfr_ptr) 0); } |