summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--mpfr.h1
-rw-r--r--mpfr.texi8
-rw-r--r--random.c33
-rw-r--r--tests/reuse.c2
-rw-r--r--tests/tabs.c4
-rw-r--r--tests/tadd.c4
-rw-r--r--tests/tadd1sp.c4
-rw-r--r--tests/tatan.c4
-rw-r--r--tests/tcmp2.c2
-rw-r--r--tests/tcomparisons.c6
-rw-r--r--tests/tdiv.c24
-rw-r--r--tests/tdiv_ui.c4
-rw-r--r--tests/teq.c2
-rw-r--r--tests/tests.c2
-rw-r--r--tests/texp.c4
-rw-r--r--tests/tfma.c46
-rw-r--r--tests/tfms.c46
-rw-r--r--tests/tgeneric_ui.c2
-rw-r--r--tests/tget_set_d64.c2
-rw-r--r--tests/tget_str.c2
-rw-r--r--tests/tmul.c4
-rw-r--r--tests/tmul_ui.c2
-rw-r--r--tests/tnext.c2
-rw-r--r--tests/tpow.c2
-rw-r--r--tests/tpow3.c4
-rw-r--r--tests/tpow_z.c2
-rw-r--r--tests/trandom.c2
-rw-r--r--tests/tset.c2
-rw-r--r--tests/tset_f.c2
-rw-r--r--tests/tset_ld.c2
-rw-r--r--tests/tset_str.c2
-rw-r--r--tests/tsgn.c2
-rw-r--r--tests/tsqr.c2
-rw-r--r--tests/tsqrt.c8
-rw-r--r--tests/tstrtofr.c44
-rw-r--r--tests/tsub.c8
-rw-r--r--tests/tsub1sp.c4
-rw-r--r--tests/tsub_ui.c2
-rw-r--r--tests/tsum.c6
-rw-r--r--tests/ttrunc.c2
-rw-r--r--tests/tui_div.c2
-rw-r--r--tests/tui_pow.c2
-rw-r--r--tests/tui_sub.c4
44 files changed, 158 insertions, 158 deletions
diff --git a/Makefile.am b/Makefile.am
index 9c4ce0ae9..cf1d58f74 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,7 @@ include_HEADERS = mpfr.h mpf2mpfr.h
lib_LTLIBRARIES = libmpfr.la
-libmpfr_la_SOURCES = mpfr.h mpf2mpfr.h mpfr-gmp.h mpfr-impl.h mpfr-longlong.h mpfr-thread.h exceptions.c extract.c uceil_exp2.c uceil_log2.c ufloor_log2.c add.c add1.c add_ui.c agm.c clear.c cmp.c cmp_abs.c cmp_si.c cmp_ui.c comparisons.c div_2exp.c div_2si.c div_2ui.c div.c div_ui.c dump.c eq.c exp10.c exp2.c exp3.c exp.c frac.c get_d.c get_exp.c get_str.c init.c inp_str.c isinteger.c isinf.c isnan.c isnum.c const_log2.c log.c modf.c mul_2exp.c mul_2si.c mul_2ui.c mul.c mul_ui.c neg.c next.c out_str.c printf.c vasprintf.c const_pi.c pow.c pow_si.c pow_ui.c print_raw.c print_rnd_mode.c random2.c random.c reldiff.c round_prec.c set.c setmax.c setmin.c set_d.c set_dfl_prec.c set_exp.c set_rnd.c set_f.c set_prc_raw.c set_prec.c set_q.c set_si.c set_str.c set_str_raw.c set_ui.c set_z.c sqrt.c sqrt_ui.c sub.c sub1.c sub_ui.c rint.c ui_div.c ui_sub.c urandomb.c get_z_exp.c swap.c factorial.c cosh.c sinh.c tanh.c sinh_cosh.c acosh.c asinh.c atanh.c atan.c cmp2.c exp_2.c asin.c const_euler.c cos.c sin.c tan.c fma.c fms.c hypot.c log1p.c expm1.c log2.c log10.c ui_pow.c ui_pow_ui.c minmax.c dim.c signbit.c copysign.c setsign.c gmp_op.c init2.c acos.c sin_cos.c set_nan.c set_inf.c powerof2.c gamma.c set_ld.c get_ld.c cbrt.c volatile.c fits_s.h fits_sshort.c fits_sint.c fits_slong.c fits_u.h fits_ushort.c fits_uint.c fits_ulong.c fits_uintmax.c fits_intmax.c get_si.c get_ui.c zeta.c cmp_d.c erf.c inits.c inits2.c clears.c sgn.c check.c sub1sp.c version.c mpn_exp.c mpfr-gmp.c mp_clz_tab.c sum.c add1sp.c free_cache.c si_op.c cmp_ld.c set_ui_2exp.c set_si_2exp.c set_uj.c set_sj.c get_sj.c get_uj.c get_z.c iszero.c cache.c sqr.c int_ceil_log2.c isqrt.c strtofr.c pow_z.c logging.c mulders.c get_f.c round_p.c erfc.c atan2.c subnormal.c const_catalan.c root.c gen_inverse.h sec.c csc.c cot.c eint.c sech.c csch.c coth.c round_near_x.c constant.c abort_prec_max.c stack_interface.c lngamma.c zeta_ui.c set_d64.c get_d64.c jn.c yn.c rem1.c get_patches.c add_d.c sub_d.c d_sub.c mul_d.c div_d.c d_div.c li2.c rec_sqrt.c
+libmpfr_la_SOURCES = mpfr.h mpf2mpfr.h mpfr-gmp.h mpfr-impl.h mpfr-longlong.h mpfr-thread.h exceptions.c extract.c uceil_exp2.c uceil_log2.c ufloor_log2.c add.c add1.c add_ui.c agm.c clear.c cmp.c cmp_abs.c cmp_si.c cmp_ui.c comparisons.c div_2exp.c div_2si.c div_2ui.c div.c div_ui.c dump.c eq.c exp10.c exp2.c exp3.c exp.c frac.c get_d.c get_exp.c get_str.c init.c inp_str.c isinteger.c isinf.c isnan.c isnum.c const_log2.c log.c modf.c mul_2exp.c mul_2si.c mul_2ui.c mul.c mul_ui.c neg.c next.c out_str.c printf.c vasprintf.c const_pi.c pow.c pow_si.c pow_ui.c print_raw.c print_rnd_mode.c random2.c reldiff.c round_prec.c set.c setmax.c setmin.c set_d.c set_dfl_prec.c set_exp.c set_rnd.c set_f.c set_prc_raw.c set_prec.c set_q.c set_si.c set_str.c set_str_raw.c set_ui.c set_z.c sqrt.c sqrt_ui.c sub.c sub1.c sub_ui.c rint.c ui_div.c ui_sub.c urandomb.c get_z_exp.c swap.c factorial.c cosh.c sinh.c tanh.c sinh_cosh.c acosh.c asinh.c atanh.c atan.c cmp2.c exp_2.c asin.c const_euler.c cos.c sin.c tan.c fma.c fms.c hypot.c log1p.c expm1.c log2.c log10.c ui_pow.c ui_pow_ui.c minmax.c dim.c signbit.c copysign.c setsign.c gmp_op.c init2.c acos.c sin_cos.c set_nan.c set_inf.c powerof2.c gamma.c set_ld.c get_ld.c cbrt.c volatile.c fits_s.h fits_sshort.c fits_sint.c fits_slong.c fits_u.h fits_ushort.c fits_uint.c fits_ulong.c fits_uintmax.c fits_intmax.c get_si.c get_ui.c zeta.c cmp_d.c erf.c inits.c inits2.c clears.c sgn.c check.c sub1sp.c version.c mpn_exp.c mpfr-gmp.c mp_clz_tab.c sum.c add1sp.c free_cache.c si_op.c cmp_ld.c set_ui_2exp.c set_si_2exp.c set_uj.c set_sj.c get_sj.c get_uj.c get_z.c iszero.c cache.c sqr.c int_ceil_log2.c isqrt.c strtofr.c pow_z.c logging.c mulders.c get_f.c round_p.c erfc.c atan2.c subnormal.c const_catalan.c root.c gen_inverse.h sec.c csc.c cot.c eint.c sech.c csch.c coth.c round_near_x.c constant.c abort_prec_max.c stack_interface.c lngamma.c zeta_ui.c set_d64.c get_d64.c jn.c yn.c rem1.c get_patches.c add_d.c sub_d.c d_sub.c mul_d.c div_d.c d_div.c li2.c rec_sqrt.c
libmpfr_la_LIBADD = @LIBOBJS@
diff --git a/mpfr.h b/mpfr.h
index ca2de2652..df345f64f 100644
--- a/mpfr.h
+++ b/mpfr.h
@@ -324,7 +324,6 @@ __MPFR_DECLSPEC void mpfr_get_z _MPFR_PROTO ((mpz_ptr z, mpfr_srcptr f,
__MPFR_DECLSPEC void mpfr_free_str _MPFR_PROTO ((char *));
-__MPFR_DECLSPEC void mpfr_random _MPFR_PROTO ((mpfr_ptr));
__MPFR_DECLSPEC void mpfr_random2 _MPFR_PROTO ((mpfr_ptr,mp_size_t,mp_exp_t));
__MPFR_DECLSPEC int mpfr_urandomb _MPFR_PROTO ((mpfr_ptr, gmp_randstate_t));
diff --git a/mpfr.texi b/mpfr.texi
index 6b9c846d3..c02868011 100644
--- a/mpfr.texi
+++ b/mpfr.texi
@@ -2248,14 +2248,6 @@ second argument is a @code{gmp_randstate_t} structure which should be
created using the GMP @code{gmp_randinit} function, see the GMP manual.
@end deftypefun
-@deftypefun void mpfr_random (mpfr_t @var{rop})
-Generate a uniformly distributed random float in the interval
-@math{0 @le{} @var{rop} < 1}.
-
-This function is deprecated and will be suppressed in the next release;
-@code{mpfr_urandomb} should be used instead.
-@end deftypefun
-
@deftypefun void mpfr_random2 (mpfr_t @var{rop}, mp_size_t @var{size}, mp_exp_t @var{exp})
Generate a random float of at most @var{size} limbs, with long strings of
zeros and ones in the binary representation. The exponent of the number is in
diff --git a/random.c b/random.c
deleted file mode 100644
index 1c5d44a18..000000000
--- a/random.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* mpfr_random -- generate a random floating-point number
-
-Copyright 1999, 2001, 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
-Contributed by the Arenaire and Cacao projects, INRIA.
-
-This file is part of the MPFR Library.
-
-The MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 2.1 of the License, or (at your
-option) any later version.
-
-The MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the MPFR Library; see the file COPYING.LIB. If not, write to
-the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-MA 02110-1301, USA. */
-
-#include "mpfr-impl.h"
-
-/* Computes a random mpfr in [0, 1[ with precision MPFR_PREC */
-
-#undef mpfr_random
-
-void
-mpfr_random (mpfr_ptr x)
-{
- mpfr_urandomb (x, RANDS);
-}
diff --git a/tests/reuse.c b/tests/reuse.c
index 2e6891a6e..dceaf1287 100644
--- a/tests/reuse.c
+++ b/tests/reuse.c
@@ -75,7 +75,7 @@ set_special (mpfr_ptr x, unsigned int select)
MPFR_SET_EXP (x, MPFR_GET_EXP (x)-1);
break;
default:
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
break;
}
}
diff --git a/tests/tabs.c b/tests/tabs.c
index 02978b813..05e0d99dd 100644
--- a/tests/tabs.c
+++ b/tests/tabs.c
@@ -42,7 +42,7 @@ check_inexact (void)
{
mpfr_set_prec (x, p);
mpfr_set_prec (absx, p);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
if (randlimb () % 2)
{
mpfr_set (absx, x, GMP_RNDN);
@@ -138,7 +138,7 @@ check_cmp (int argc, char *argv[])
mp_rnd_t rnd;
int sign = SIGN_RAND ();
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
MPFR_SET_SIGN (x, sign);
rnd = RND_RAND ();
mpfr_abs (y, x, rnd);
diff --git a/tests/tadd.c b/tests/tadd.c
index 0a3d1e887..ab111ed8d 100644
--- a/tests/tadd.c
+++ b/tests/tadd.c
@@ -512,7 +512,7 @@ check_inexact (void)
mpfr_set_prec (x, px);
do
{
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
}
while (mpfr_cmp_ui (x, 0) == 0);
for (pu=2; pu<MAX_PREC; pu++)
@@ -520,7 +520,7 @@ check_inexact (void)
mpfr_set_prec (u, pu);
do
{
- mpfr_random (u);
+ mpfr_urandomb (u, RANDS);
}
while (mpfr_cmp_ui (u, 0) == 0);
{
diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c
index 5ca46250c..e85c61f92 100644
--- a/tests/tadd1sp.c
+++ b/tests/tadd1sp.c
@@ -114,8 +114,8 @@ void check_random(mp_prec_t p)
for (i = 0 ; i < 500 ; i++)
{
- mpfr_random(b);
- mpfr_random(c);
+ mpfr_urandomb (b, RANDS);
+ mpfr_urandomb (c, RANDS);
if (MPFR_IS_PURE_FP(b) && MPFR_IS_PURE_FP(c))
{
if (MPFR_GET_EXP(b) < MPFR_GET_EXP(c))
diff --git a/tests/tatan.c b/tests/tatan.c
index 7ddc0b68f..36107e496 100644
--- a/tests/tatan.c
+++ b/tests/tatan.c
@@ -201,7 +201,7 @@ special (void)
#define TEST_FUNCTION mpfr_atan
#define test_generic test_generic_atan
-#define RAND_FUNCTION(x) (mpfr_random (x), mpfr_mul_2si (x, x, (randlimb () %1000-500), GMP_RNDN))
+#define RAND_FUNCTION(x) (mpfr_urandomb (x, RANDS), mpfr_mul_2si (x, x, (randlimb () %1000-500), GMP_RNDN))
#include "tgeneric.c"
#define TEST_FUNCTION mpfr_atan2
@@ -211,7 +211,7 @@ special (void)
#define TEST_FUNCTION mpfr_atan2
#define TWO_ARGS
-#define RAND_FUNCTION(x) (mpfr_random (x), MPFR_SET_NEG (x))
+#define RAND_FUNCTION(x) (mpfr_urandomb (x, RANDS), MPFR_SET_NEG (x))
#define test_generic test_generic_atan2_neg
#include "tgeneric.c"
diff --git a/tests/tcmp2.c b/tests/tcmp2.c
index 7696f78b9..374528949 100644
--- a/tests/tcmp2.c
+++ b/tests/tcmp2.c
@@ -88,7 +88,7 @@ worst_cases (void)
for (i = 0; i < 64; i++) /* |u| = i */
{
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_set (y, x, GMP_RNDN);
set_bit (x, i + 1, 1);
set_bit (y, i + 1, 0);
diff --git a/tests/tcomparisons.c b/tests/tcomparisons.c
index 784f55c98..34eab39a6 100644
--- a/tests/tcomparisons.c
+++ b/tests/tcomparisons.c
@@ -44,8 +44,8 @@ cmp_tests (void)
precy = (randlimb () % 17) * 11 + MPFR_PREC_MIN;
mpfr_set_prec (x, precx);
mpfr_set_prec (y, precy);
- mpfr_random (x);
- mpfr_random (y);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (y, RANDS);
signx = randlimb () & 1;
signy = randlimb () % 256 ? signx : 1 - signx;
/* signy = signx most of the time (most interesting case) */
@@ -102,7 +102,7 @@ eq_tests (void)
precx = (randlimb () % 17) * 11 + MPFR_PREC_MIN;
mpfr_set_prec (x, precx);
mpfr_set_prec (y, precx + (randlimb () % 64));
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
if (randlimb () & 1)
mpfr_neg (x, x, GMP_RNDN);
mpfr_set (y, x, GMP_RNDN); /* exact -> x = y */
diff --git a/tests/tdiv.c b/tests/tdiv.c
index 3e87e5355..d9f21352c 100644
--- a/tests/tdiv.c
+++ b/tests/tdiv.c
@@ -302,7 +302,7 @@ check_hard (void)
{
do
{
- mpfr_random (q2);
+ mpfr_urandomb (q2, RANDS);
}
while (mpfr_cmp_ui (q2, 0) == 0);
}
@@ -313,7 +313,7 @@ check_hard (void)
mpfr_set_prec (v, precv);
do
{
- mpfr_random (v);
+ mpfr_urandomb (v, RANDS);
}
while (mpfr_cmp_ui (v, 0) == 0);
for (precu = precq; precu <= 10 * precq; precu += precq)
@@ -371,12 +371,12 @@ check_lowr (void)
{
do
{
- mpfr_random (z);
+ mpfr_urandomb (z, RANDS);
}
while (mpfr_cmp_ui (z, 0) == 0);
do
{
- mpfr_random (tmp);
+ mpfr_urandomb (tmp, RANDS);
}
while (mpfr_cmp_ui (tmp, 0) == 0);
mpfr_mul (x, z, tmp, GMP_RNDN); /* exact */
@@ -396,10 +396,10 @@ check_lowr (void)
mpfr_set_prec (z2, 9);
for (k = 1; k < KMAX; k++)
{
- mpfr_random (z);
+ mpfr_urandomb (z, RANDS);
do
{
- mpfr_random (tmp);
+ mpfr_urandomb (tmp, RANDS);
}
while (mpfr_cmp_ui (tmp, 0) == 0);
mpfr_mul (x, z, tmp, GMP_RNDN); /* exact */
@@ -455,12 +455,12 @@ check_lowr (void)
{
do
{
- mpfr_random(z);
+ mpfr_urandomb (z, RANDS);
}
while (mpfr_cmp_ui (z, 0) == 0);
do
{
- mpfr_random (tmp);
+ mpfr_urandomb (tmp, RANDS);
}
while (mpfr_cmp_ui (tmp, 0) == 0);
mpfr_mul(x, z, tmp, GMP_RNDN);
@@ -579,11 +579,11 @@ check_inexact (void)
for (px=2; px<MAX_PREC; px++)
{
mpfr_set_prec (x, px);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
for (pu=2; pu<=MAX_PREC; pu++)
{
mpfr_set_prec (u, pu);
- do { mpfr_random (u); } while (mpfr_cmp_ui (u, 0) == 0);
+ do { mpfr_urandomb (u, RANDS); } while (mpfr_cmp_ui (u, 0) == 0);
{
py = MPFR_PREC_MIN + (randlimb () % (MAX_PREC - MPFR_PREC_MIN));
mpfr_set_prec (y, py);
@@ -778,9 +778,9 @@ consistency (void)
mpfr_set_prec (y, py);
mpfr_set_prec (z1, pz);
mpfr_set_prec (z2, pz);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
do
- mpfr_random (y);
+ mpfr_urandomb (y, RANDS);
while (mpfr_zero_p (y));
inex1 = mpfr_div (z1, x, y, rnd);
MPFR_ASSERTN (!MPFR_IS_NAN (z1));
diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c
index f6ba84cb6..a2912653d 100644
--- a/tests/tdiv_ui.c
+++ b/tests/tdiv_ui.c
@@ -63,7 +63,7 @@ special (void)
mpfr_set_prec (x, 100);
mpfr_set_prec (y, 100);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_div_ui (y, x, 123456, GMP_RNDN);
mpfr_set_ui (x, 0, GMP_RNDN);
mpfr_div_ui (y, x, 123456789, GMP_RNDN);
@@ -156,7 +156,7 @@ check_inexact (void)
for (px=2; px<300; px++)
{
mpfr_set_prec (x, px);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
do
{
u = randlimb ();
diff --git a/tests/teq.c b/tests/teq.c
index 0dffe9b9f..d327d4ffc 100644
--- a/tests/teq.c
+++ b/tests/teq.c
@@ -197,7 +197,7 @@ main (void)
for (j = 0; j < 500; j++)
{
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
teq (x);
}
diff --git a/tests/tests.c b/tests/tests.c
index 01af19394..8b56e516f 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -482,7 +482,7 @@ tests_default_random (mpfr_ptr x, int pos, mp_exp_t emin, mp_exp_t emax)
exponent range (see below), so that underflow/overflow checks
can be done on 64-bit machines. */
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
if (MPFR_IS_PURE_FP (x) && (emin >= 1 || (randlimb () & 1)))
{
mp_exp_t e;
diff --git a/tests/texp.c b/tests/texp.c
index a765e5864..0f0dfc489 100644
--- a/tests/texp.c
+++ b/tests/texp.c
@@ -141,7 +141,7 @@ check_worst_cases (void)
mpfr_set_prec (x, 13001);
mpfr_set_prec (y, 13001);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_exp_3 (y, x, GMP_RNDN);
mpfr_exp_2 (x, x, GMP_RNDN);
if (mpfr_cmp (x, y))
@@ -170,7 +170,7 @@ compare_exp2_exp3 (mp_prec_t p0, mp_prec_t p1)
mpfr_set_prec (x, prec);
mpfr_set_prec (y, prec);
mpfr_set_prec (z, prec);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
rnd = RND_RAND ();
mpfr_exp_2 (y, x, rnd);
mpfr_exp_3 (z, x, rnd);
diff --git a/tests/tfma.c b/tests/tfma.c
index 5840167a4..95767b1f4 100644
--- a/tests/tfma.c
+++ b/tests/tfma.c
@@ -381,8 +381,8 @@ main (int argc, char *argv[])
}
mpfr_set_nan (x);
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
{
@@ -391,8 +391,8 @@ main (int argc, char *argv[])
}
mpfr_set_nan (y);
- mpfr_random (x);
- mpfr_random (z);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p(s))
{
@@ -401,8 +401,8 @@ main (int argc, char *argv[])
}
mpfr_set_nan (z);
- mpfr_random (y);
- mpfr_random (x);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (x, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
{
@@ -452,7 +452,7 @@ main (int argc, char *argv[])
mpfr_set_inf (x, 1);
mpfr_set_ui (y, 0, GMP_RNDN);
- mpfr_random (z);
+ mpfr_urandomb (z, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
{
@@ -462,7 +462,7 @@ main (int argc, char *argv[])
mpfr_set_inf (y, 1);
mpfr_set_ui (x, 0, GMP_RNDN);
- mpfr_random (z);
+ mpfr_urandomb (z, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
{
@@ -471,7 +471,7 @@ main (int argc, char *argv[])
}
mpfr_set_inf (x, 1);
- mpfr_random (y); /* always positive */
+ mpfr_urandomb (y, RANDS); /* always positive */
mpfr_set_inf (z, -1);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
@@ -481,7 +481,7 @@ main (int argc, char *argv[])
}
mpfr_set_inf (y, 1);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_set_inf (z, -1);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
@@ -491,8 +491,8 @@ main (int argc, char *argv[])
}
mpfr_set_inf (x, 1);
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_inf_p (s) || mpfr_sgn (s) < 0)
{
@@ -501,8 +501,8 @@ main (int argc, char *argv[])
}
mpfr_set_inf (y, 1);
- mpfr_random (x);
- mpfr_random (z);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_inf_p (s) || mpfr_sgn (s) < 0)
{
@@ -511,8 +511,8 @@ main (int argc, char *argv[])
}
mpfr_set_inf (z, 1);
- mpfr_random (x);
- mpfr_random (y);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (y, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (!mpfr_inf_p (s) || mpfr_sgn (s) < 0)
{
@@ -521,8 +521,8 @@ main (int argc, char *argv[])
}
mpfr_set_ui (x, 0, GMP_RNDN);
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (mpfr_cmp (s, z))
{
@@ -531,8 +531,8 @@ main (int argc, char *argv[])
}
mpfr_set_ui (y, 0, GMP_RNDN);
- mpfr_random (x);
- mpfr_random (z);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fma (s, x, y, z, GMP_RNDN);
if (mpfr_cmp (s, z))
{
@@ -564,9 +564,9 @@ main (int argc, char *argv[])
for (n=0; n<N; n++)
{
- mpfr_random (x);
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
if (randlimb () % 2)
mpfr_neg (x, x, GMP_RNDN);
diff --git a/tests/tfms.c b/tests/tfms.c
index 8717e0584..f19e68055 100644
--- a/tests/tfms.c
+++ b/tests/tfms.c
@@ -382,8 +382,8 @@ main (int argc, char *argv[])
}
mpfr_set_nan (x);
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
{
@@ -392,8 +392,8 @@ main (int argc, char *argv[])
}
mpfr_set_nan (y);
- mpfr_random (x);
- mpfr_random (z);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p(s))
{
@@ -402,8 +402,8 @@ main (int argc, char *argv[])
}
mpfr_set_nan (z);
- mpfr_random (y);
- mpfr_random (x);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (x, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
{
@@ -453,7 +453,7 @@ main (int argc, char *argv[])
mpfr_set_inf (x, 1);
mpfr_set_ui (y, 0, GMP_RNDN);
- mpfr_random (z);
+ mpfr_urandomb (z, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
{
@@ -463,7 +463,7 @@ main (int argc, char *argv[])
mpfr_set_inf (y, 1);
mpfr_set_ui (x, 0, GMP_RNDN);
- mpfr_random (z);
+ mpfr_urandomb (z, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
{
@@ -472,7 +472,7 @@ main (int argc, char *argv[])
}
mpfr_set_inf (x, 1);
- mpfr_random (y); /* always positive */
+ mpfr_urandomb (y, RANDS); /* always positive */
mpfr_set_inf (z, 1);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
@@ -482,7 +482,7 @@ main (int argc, char *argv[])
}
mpfr_set_inf (y, 1);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_set_inf (z, 1);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_nan_p (s))
@@ -492,8 +492,8 @@ main (int argc, char *argv[])
}
mpfr_set_inf (x, 1);
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_inf_p (s) || mpfr_sgn (s) < 0)
{
@@ -502,8 +502,8 @@ main (int argc, char *argv[])
}
mpfr_set_inf (y, 1);
- mpfr_random (x);
- mpfr_random (z);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_inf_p (s) || mpfr_sgn (s) < 0)
{
@@ -512,8 +512,8 @@ main (int argc, char *argv[])
}
mpfr_set_inf (z, -1);
- mpfr_random (x);
- mpfr_random (y);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (y, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
if (!mpfr_inf_p (s) || mpfr_sgn (s) < 0)
{
@@ -522,8 +522,8 @@ main (int argc, char *argv[])
}
mpfr_set_ui (x, 0, GMP_RNDN);
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
mpfr_neg (z, z, GMP_RNDN);
if (mpfr_cmp (s, z))
@@ -533,8 +533,8 @@ main (int argc, char *argv[])
}
mpfr_set_ui (y, 0, GMP_RNDN);
- mpfr_random (x);
- mpfr_random (z);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (z, RANDS);
mpfr_fms (s, x, y, z, GMP_RNDN);
mpfr_neg (z, z, GMP_RNDN);
if (mpfr_cmp (s, z))
@@ -567,9 +567,9 @@ main (int argc, char *argv[])
for (n=0; n<N; n++)
{
- mpfr_random (x);
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
if (randlimb () % 2)
mpfr_neg (x, x, GMP_RNDN);
diff --git a/tests/tgeneric_ui.c b/tests/tgeneric_ui.c
index f479cae0a..62074ca58 100644
--- a/tests/tgeneric_ui.c
+++ b/tests/tgeneric_ui.c
@@ -25,7 +25,7 @@ MA 02110-1301, USA. */
# define INTEGER_TYPE mp_limb_t
#endif
#ifndef RAND_FUNCTION
-# define RAND_FUNCTION mpfr_random
+# define RAND_FUNCTION(x) mpfr_urandomb ((x), RANDS)
#endif
#ifndef INT_RAND_FUNCTION
# define INT_RAND_FUNCTION() (INTEGER_TYPE) randlimb ()
diff --git a/tests/tget_set_d64.c b/tests/tget_set_d64.c
index b4eb2beff..fa709a3c1 100644
--- a/tests/tget_set_d64.c
+++ b/tests/tget_set_d64.c
@@ -177,7 +177,7 @@ check_random (void)
for (i = 0; i < 100000; i++)
{
- mpfr_random (x); /* 0 <= x < 1 */
+ mpfr_urandomb (x, RANDS); /* 0 <= x < 1 */
/* the normal decimal64 range contains [2^(-1272), 2^1278] */
mpfr_mul_2si (x, x, (i % 2550) - 1272, GMP_RNDN);
if (mpfr_get_exp (x) <= -1272)
diff --git a/tests/tget_str.c b/tests/tget_str.c
index 6e50c14ea..01b14eed5 100644
--- a/tests/tget_str.c
+++ b/tests/tget_str.c
@@ -1149,7 +1149,7 @@ main (int argc, char *argv[])
for (i = 0; i < ITER; i++)
{
m = 2 + (randlimb () % (MAX_DIGITS - 1));
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
e = (mp_exp_t) (randlimb () % 21) - 10;
mpfr_set_exp (x, (e == -10) ? mpfr_get_emin () :
((e == 10) ? mpfr_get_emax () : e));
diff --git a/tests/tmul.c b/tests/tmul.c
index efa82aac2..f4f84c333 100644
--- a/tests/tmul.c
+++ b/tests/tmul.c
@@ -241,8 +241,8 @@ check_exact (void)
mpfr_set_prec (d, 2 * prec);
for (i = 0; i < 1000; i++)
{
- mpfr_random (a);
- mpfr_random (b);
+ mpfr_urandomb (a, RANDS);
+ mpfr_urandomb (b, RANDS);
rnd = RND_RAND ();
inexact = test_mul (c, a, b, rnd);
if (test_mul (d, a, b, rnd)) /* should be always exact */
diff --git a/tests/tmul_ui.c b/tests/tmul_ui.c
index ad86fd621..f95865291 100644
--- a/tests/tmul_ui.c
+++ b/tests/tmul_ui.c
@@ -37,7 +37,7 @@ check_inexact (mp_prec_t p)
mpfr_init2 (x, p);
mpfr_init (y);
mpfr_init2 (z, p + mp_bits_per_limb);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
u = randlimb ();
if (mpfr_mul_ui (z, x, u, GMP_RNDN))
{
diff --git a/tests/tnext.c b/tests/tnext.c
index 1ec3ddfba..523b75145 100644
--- a/tests/tnext.c
+++ b/tests/tnext.c
@@ -61,7 +61,7 @@ generic_abovebelow (void)
}
do
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
while (mpfr_cmp_ui (x, 0) == 0);
neg = randlimb () & 1;
if (neg)
diff --git a/tests/tpow.c b/tests/tpow.c
index 4e617d0a6..54269b19b 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -423,7 +423,7 @@ check_inexact (mp_prec_t p)
mpfr_init (y);
mpfr_init (z);
mpfr_init (t);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
u = randlimb () % 2;
for (q = 2; q <= p; q++)
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
diff --git a/tests/tpow3.c b/tests/tpow3.c
index 642f5eb23..9de33cb1f 100644
--- a/tests/tpow3.c
+++ b/tests/tpow3.c
@@ -61,8 +61,8 @@ main (int argc, char *argv[])
for (n=0; n<N; n++)
{
- mpfr_random (x);
- mpfr_random (s);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (s, RANDS);
if (randlimb () % 2)
mpfr_neg (s, s, GMP_RNDN);
rnd = RND_RAND ();
diff --git a/tests/tpow_z.c b/tests/tpow_z.c
index 917f3c4f7..428bbf099 100644
--- a/tests/tpow_z.c
+++ b/tests/tpow_z.c
@@ -159,7 +159,7 @@ check_integer (mp_prec_t begin, mp_prec_t end, unsigned long max)
mpz_urandomb (z, RANDS, GMP_NUMB_BITS);
if ((i & 1) != 0)
mpz_neg (z, z);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_mul_2ui (x, x, 1, GMP_RNDN); /* 0 <= x < 2 */
rnd = RND_RAND ();
if (mpz_fits_slong_p (z))
diff --git a/tests/trandom.c b/tests/trandom.c
index c8f4c7b5e..163eb6beb 100644
--- a/tests/trandom.c
+++ b/tests/trandom.c
@@ -44,7 +44,7 @@ test_random (long nbtests, mp_prec_t prec, int verbose)
for (k = 0; k < nbtests; k++)
{
- mpfr_random(x);
+ mpfr_urandomb (x, RANDS);
d = mpfr_get_d1 (x); av += d; var += d*d;
tab[(int)(size_tab * d)]++;
}
diff --git a/tests/tset.c b/tests/tset.c
index 6629815e8..83538991e 100644
--- a/tests/tset.c
+++ b/tests/tset.c
@@ -115,7 +115,7 @@ main (void)
for (p=2; p<500; p++)
{
mpfr_set_prec (x, p);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
if (randlimb () % 2)
mpfr_neg (x, x, GMP_RNDN);
for (q=2; q<2*p; q++)
diff --git a/tests/tset_f.c b/tests/tset_f.c
index e4ddc21db..903c5ab95 100644
--- a/tests/tset_f.c
+++ b/tests/tset_f.c
@@ -150,7 +150,7 @@ main (void)
mpf_set_ui (y, 1);
for (r = 0; r < mp_bits_per_limb; r++)
{
- mpfr_random (x); /* to fill low limbs with random data */
+ mpfr_urandomb (x, RANDS); /* to fill low limbs with random data */
inexact = mpfr_set_f (x, y, GMP_RNDN);
MPFR_ASSERTN(inexact == 0 && mpfr_cmp_ui_2exp (x, 1, r) == 0);
mpf_mul_2exp (y, y, 1);
diff --git a/tests/tset_ld.c b/tests/tset_ld.c
index 752b18424..4acc58696 100644
--- a/tests/tset_ld.c
+++ b/tests/tset_ld.c
@@ -221,7 +221,7 @@ main (int argc, char *argv[])
for (i = 0; i < 10000; i++)
{
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
d = mpfr_get_ld (x, GMP_RNDN);
check_set_get (d, x);
}
diff --git a/tests/tset_str.c b/tests/tset_str.c
index 30c97f6c8..83f5b23bc 100644
--- a/tests/tset_str.c
+++ b/tests/tset_str.c
@@ -203,7 +203,7 @@ main (int argc, char *argv[])
{
mp_rnd_t rnd;
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
rnd = RND_RAND ();
logbase = (randlimb () % 5) + 1;
base = 1 << logbase;
diff --git a/tests/tsgn.c b/tests/tsgn.c
index 47f090b77..3e152ee33 100644
--- a/tests/tsgn.c
+++ b/tests/tsgn.c
@@ -79,7 +79,7 @@ check_sgn(void)
mpfr_init(x);
for(i = 0 ; i < 100 ; i++)
{
- mpfr_random(x);
+ mpfr_urandomb (x, RANDS);
if (i&1)
{
MPFR_SET_POS(x);
diff --git a/tests/tsqr.c b/tests/tsqr.c
index 9afef9a00..729c82989 100644
--- a/tests/tsqr.c
+++ b/tests/tsqr.c
@@ -66,7 +66,7 @@ check_random (mpfr_prec_t p)
mpfr_inits2 (p, x, y, z, (mpfr_ptr) 0);
for(i = 0 ; i < 500 ; i++)
{
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
if (MPFR_IS_PURE_FP(x))
for (r = 0 ; r < GMP_RND_MAX ; r++)
{
diff --git a/tests/tsqrt.c b/tests/tsqrt.c
index 83c64cea5..43867e63c 100644
--- a/tests/tsqrt.c
+++ b/tests/tsqrt.c
@@ -423,7 +423,7 @@ check_inexact (mp_prec_t p)
mpfr_init2 (x, p);
mpfr_init2 (y, p);
mpfr_init2 (z, 2*p);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
rnd = RND_RAND ();
inexact = test_sqrt (y, x, rnd);
if (mpfr_mul (z, y, y, rnd)) /* exact since prec(z) = 2*prec(y) */
@@ -505,8 +505,8 @@ test_property1 (mp_prec_t p, mp_rnd_t r)
mpfr_init2 (z, p);
mpfr_init2 (t, p);
- mpfr_random (x);
- mpfr_random (y);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (y, RANDS);
mpfr_mul (z, x, x, r);
mpfr_mul (t, x, x, r);
mpfr_add (z, z, t, r);
@@ -537,7 +537,7 @@ test_property2 (mp_prec_t p, mp_rnd_t r)
mpfr_init2 (x, p);
mpfr_init2 (y, p);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_mul (y, x, x, r);
mpfr_sqrt (y, y, r);
if (mpfr_cmp (y, x))
diff --git a/tests/tstrtofr.c b/tests/tstrtofr.c
index 3a0862809..ebde17232 100644
--- a/tests/tstrtofr.c
+++ b/tests/tstrtofr.c
@@ -33,11 +33,53 @@ static void check_retval (void);
static void check_overflow (void);
static void check_parse (void);
+static void
+check_underflow ()
+{
+ mpfr_t x, y;
+ int res;
+ char *s;
+ mp_exp_t svg;
+
+ mpfr_init (x);
+ mpfr_init (y);
+
+ mpfr_set_ui (x, 0, GMP_RNDN);
+ mpfr_nextabove (x);
+
+ mpfr_strtofr (y, "0b100p-1073741826", NULL, 0, GMP_RNDN);
+ if (mpfr_cmp (x, y))
+ {
+ mpfr_dump (x);
+ mpfr_dump (y);
+ exit (1);
+ }
+
+ svg = mpfr_get_emin ();
+ mpfr_set_emin (MPFR_EMIN_MIN);
+ mpfr_set_ui (x, 0, GMP_RNDN);
+ mpfr_nextabove (x);
+
+ mpfr_strtofr (y, "0b100p-4611686018427387906", NULL, 0, GMP_RNDN);
+ if (mpfr_cmp (x, y))
+ {
+ mpfr_dump (x);
+ mpfr_dump (y);
+ exit (1);
+ }
+ mpfr_set_emin (svg);
+
+ mpfr_clear (x);
+ mpfr_clear (y);
+}
+
int
main (int argc, char *argv[])
{
tests_start_mpfr ();
+ check_underflow ();
+
check_special();
check_reftable ();
check_parse ();
@@ -230,7 +272,7 @@ int main()
base = randomab (2, 30);
e = randomab (-1<<15, 1<<15);
mpfr_set_prec (x, p);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_mul_2si (x, x, e, GMP_RNDN);
printf("{%lu, %d,\n\"", p, base);
mpfr_out_str (stdout, base, p, x, GMP_RNDN);
diff --git a/tests/tsub.c b/tests/tsub.c
index ec3849758..66ec67ed5 100644
--- a/tests/tsub.c
+++ b/tests/tsub.c
@@ -355,8 +355,8 @@ check_two_sum (mp_prec_t p)
mpfr_init2 (u, p);
mpfr_init2 (v, p);
mpfr_init2 (w, p);
- mpfr_random (x);
- mpfr_random (y);
+ mpfr_urandomb (x, RANDS);
+ mpfr_urandomb (y, RANDS);
if (mpfr_cmpabs (x, y) < 0)
mpfr_swap (x, y);
rnd = GMP_RNDN;
@@ -418,7 +418,7 @@ check_inexact (void)
mpfr_set_prec (x, px);
do
{
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
}
while (mpfr_cmp_ui (x, 0) == 0);
for (pu=2; pu<MAX_PREC; pu++)
@@ -426,7 +426,7 @@ check_inexact (void)
mpfr_set_prec (u, pu);
do
{
- mpfr_random (u);
+ mpfr_urandomb (u, RANDS);
}
while (mpfr_cmp_ui (u, 0) == 0);
{
diff --git a/tests/tsub1sp.c b/tests/tsub1sp.c
index 25708235e..bac989885 100644
--- a/tests/tsub1sp.c
+++ b/tests/tsub1sp.c
@@ -76,8 +76,8 @@ void check_random(mpfr_prec_t p)
for (i = 0 ; i < 500 ; i++)
{
- mpfr_random (y);
- mpfr_random (z);
+ mpfr_urandomb (y, RANDS);
+ mpfr_urandomb (z, RANDS);
if (MPFR_IS_PURE_FP(y) && MPFR_IS_PURE_FP(z))
for(r = 0 ; r < GMP_RND_MAX ; r++)
{
diff --git a/tests/tsub_ui.c b/tests/tsub_ui.c
index 9ddb0ae45..ef69df326 100644
--- a/tests/tsub_ui.c
+++ b/tests/tsub_ui.c
@@ -63,7 +63,7 @@ check_two_sum (mp_prec_t p)
x = randlimb ();
}
while (x < 1);
- mpfr_random (y);
+ mpfr_urandomb (y, RANDS);
rnd = GMP_RNDN;
inexact = mpfr_sub_ui (u, y, x, rnd);
mpfr_add_ui (v, u, x, rnd);
diff --git a/tests/tsum.c b/tests/tsum.c
index fd45eb2a9..12469d559 100644
--- a/tests/tsum.c
+++ b/tests/tsum.c
@@ -117,7 +117,7 @@ test_sort (mp_prec_t f, unsigned long n)
for (i = 0; i < n; i++)
{
- mpfr_random (tab[i]);
+ mpfr_urandomb (tab[i], RANDS);
tabtmp[i] = tab[i];
}
@@ -155,7 +155,7 @@ test_sum (mp_prec_t f, unsigned long n)
/* First Uniform */
for (i = 0; i < n; i++)
- mpfr_random (tab[i]);
+ mpfr_urandomb (tab[i], RANDS);
algo_exact (real_non_rounded, tab, n, f);
for (rnd_mode = 0; rnd_mode < GMP_RND_MAX; rnd_mode++)
{
@@ -173,7 +173,7 @@ test_sum (mp_prec_t f, unsigned long n)
/* Then non uniform */
for (i = 0; i < n; i++)
{
- mpfr_random (tab[i]);
+ mpfr_urandomb (tab[i], RANDS);
mpfr_set_exp (tab[i], randlimb () %1000);
}
algo_exact (real_non_rounded, tab, n, f);
diff --git a/tests/ttrunc.c b/tests/ttrunc.c
index 4700f3b71..9e05f5acc 100644
--- a/tests/ttrunc.c
+++ b/tests/ttrunc.c
@@ -69,7 +69,7 @@ main (void)
for (j=0;j<1000;j++)
{
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
MPFR_EXP (x) = 2;
for (k = 2; k <= SIZEX; k++)
diff --git a/tests/tui_div.c b/tests/tui_div.c
index e64f72041..32fc7c916 100644
--- a/tests/tui_div.c
+++ b/tests/tui_div.c
@@ -63,7 +63,7 @@ check_inexact (void)
mpfr_set_prec (x, px);
do
{
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
}
while (mpfr_cmp_ui (x, 0) == 0);
u = randlimb ();
diff --git a/tests/tui_pow.c b/tests/tui_pow.c
index 7f87f0a1f..d436b961c 100644
--- a/tests/tui_pow.c
+++ b/tests/tui_pow.c
@@ -247,7 +247,7 @@ main (int argc, char *argv[])
{
int nt;
nt = randlimb () & INT_MAX;
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
rnd = RND_RAND ();
check1 (x, prec, nt, rnd);
}
diff --git a/tests/tui_sub.c b/tests/tui_sub.c
index e6e273427..0aaaeeb08 100644
--- a/tests/tui_sub.c
+++ b/tests/tui_sub.c
@@ -122,7 +122,7 @@ special (void)
mpfr_set_prec (x, 10);
mpfr_set_prec (y, 10);
- mpfr_random (x);
+ mpfr_urandomb (x, RANDS);
mpfr_ui_sub (y, 0, x, GMP_RNDN);
if (MPFR_IS_ZERO(x))
MPFR_ASSERTN(MPFR_IS_ZERO(y));
@@ -175,7 +175,7 @@ check_two_sum (mp_prec_t p)
x = randlimb ();
}
while (x < 1);
- mpfr_random (y);
+ mpfr_urandomb (y, RANDS);
rnd = GMP_RNDN;
inexact = mpfr_ui_sub (u, x, y, rnd);
mpfr_sub_ui (v, u, x, rnd);