summaryrefslogtreecommitdiff
path: root/tests/tsqrt.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2021-03-16 06:24:20 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2021-03-16 06:24:20 +0000
commit1262692b23b80b8cb718a3e330a49e539e9b8144 (patch)
tree9c5e6ec63369df04bdf1bf868128c009a2c8e302 /tests/tsqrt.c
parentb740331462e4b3ae01492e00730b194a6337eb9c (diff)
downloadmpfr-1262692b23b80b8cb718a3e330a49e539e9b8144.tar.gz
[src/rec_sqrt.c] replace a call to mpn_mul_n with identical arguments by
a call to mpn_sqr + similar changes in other files (thanks Fredrik Johansson) git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14475 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsqrt.c')
-rw-r--r--tests/tsqrt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/tsqrt.c b/tests/tsqrt.c
index 9d810fc5c..48fd01932 100644
--- a/tests/tsqrt.c
+++ b/tests/tsqrt.c
@@ -350,7 +350,7 @@ special (void)
mpfr_set_exp (x, GMP_NUMB_BITS);
mpfr_add_ui (x, x, 1, MPFR_RNDN);
/* now x = 2^(GMP_NUMB_BITS - 1) + 1 (GMP_NUMB_BITS bits) */
- inexact = mpfr_mul (x, x, x, MPFR_RNDN);
+ inexact = mpfr_sqr (x, x, MPFR_RNDN);
MPFR_ASSERTN (inexact == 0); /* exact */
inexact = test_sqrt (z, x, MPFR_RNDN);
/* even rule: z should be 2^(GMP_NUMB_BITS - 1) */
@@ -429,7 +429,7 @@ check_inexact (mpfr_prec_t p)
mpfr_urandomb (x, RANDS);
rnd = RND_RAND_NO_RNDF ();
inexact = test_sqrt (y, x, rnd);
- if (mpfr_mul (z, y, y, rnd)) /* exact since prec(z) = 2*prec(y) */
+ if (mpfr_sqr (z, y, rnd)) /* exact since prec(z) = 2*prec(y) */
{
printf ("Error: multiplication should be exact\n");
exit (1);
@@ -902,7 +902,7 @@ coverage (void)
mpfr_nextabove (w); /* w = nextabove(v) */
mpfr_set (t, v, MPFR_RNDN);
mpfr_nextabove (t);
- mpfr_mul (u, t, t, MPFR_RNDN);
+ mpfr_sqr (u, t, MPFR_RNDN);
inex = mpfr_sqrt (r, u, MPFR_RNDN);
if (mpfr_min_prec (v) < p) /* v is even */
{