summaryrefslogtreecommitdiff
path: root/tests/tdiv_ui.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-06-30 09:57:36 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-06-30 09:57:36 +0000
commitdb110f3c56448f3084cc474bf4185ee2486ae96b (patch)
tree24f505fec32f9b67f9820330704f60a79bf9ada8 /tests/tdiv_ui.c
parent4be6dad958efb74af2abde7c50f654ebcbb4d7d2 (diff)
downloadmpfr-db110f3c56448f3084cc474bf4185ee2486ae96b.tar.gz
New macros for mpfr_{mul,div}_ui to optimize the call when the integer
is a constant number that is a power of 2. New macros for mpfr_{mul,div}_si to optimize the call when the integer is a constant number that is positive. (Modified patch from Patrick PĂ©lissier) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9111 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tdiv_ui.c')
-rw-r--r--tests/tdiv_ui.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c
index 043a092fa..bb679a079 100644
--- a/tests/tdiv_ui.c
+++ b/tests/tdiv_ui.c
@@ -95,6 +95,8 @@ special (void)
mpfr_nextabove (x);
mpfr_div_ui (y, x, 2, MPFR_RNDN); /* exactly in the middle */
MPFR_ASSERTN(mpfr_cmp_ui (y, 2) == 0);
+ (mpfr_div_ui) (y, x, 2, MPFR_RNDN); /* exactly in the middle */
+ MPFR_ASSERTN(mpfr_cmp_ui (y, 2) == 0);
mpfr_set_prec (x, 3 * mp_bits_per_limb);
mpfr_set_prec (y, 2);
@@ -102,6 +104,8 @@ special (void)
mpfr_nextabove (x);
mpfr_div_ui (y, x, 2, MPFR_RNDN);
MPFR_ASSERTN(mpfr_cmp_ui (y, 1) == 0);
+ (mpfr_div_ui) (y, x, 2, MPFR_RNDN);
+ MPFR_ASSERTN(mpfr_cmp_ui (y, 1) == 0);
mpfr_set_prec (x, 3 * mp_bits_per_limb);
mpfr_set_prec (y, 2);
@@ -109,6 +113,8 @@ special (void)
mpfr_nextbelow (x);
mpfr_div_ui (y, x, 2, MPFR_RNDD);
MPFR_ASSERTN(mpfr_cmp_si (y, -3) == 0);
+ (mpfr_div_ui) (y, x, 2, MPFR_RNDD);
+ MPFR_ASSERTN(mpfr_cmp_si (y, -3) == 0);
for (xprec = 53; xprec <= 128; xprec++)
{
@@ -133,6 +139,8 @@ special (void)
mpfr_set_si (y, -1, MPFR_RNDN);
mpfr_div_ui (y, x, 4, MPFR_RNDN);
MPFR_ASSERTN(MPFR_IS_ZERO(y) && MPFR_IS_POS(y));
+ (mpfr_div_ui) (y, x, 4, MPFR_RNDN);
+ MPFR_ASSERTN(MPFR_IS_ZERO(y) && MPFR_IS_POS(y));
mpfr_clear (x);
mpfr_clear (y);