summaryrefslogtreecommitdiff
path: root/tests/mpfr-test.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mpfr-test.h')
-rw-r--r--tests/mpfr-test.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/mpfr-test.h b/tests/mpfr-test.h
index 616ef4119..c7d5f1057 100644
--- a/tests/mpfr-test.h
+++ b/tests/mpfr-test.h
@@ -51,12 +51,19 @@ extern "C" {
/* Generates a random rounding mode */
#define RND_RAND() ((mpfr_rnd_t) (randlimb() % MPFR_RND_MAX))
+/* Ditto, excluding RNDF, assumed to be the last rounding mode */
+#define RND_RAND_NO_RNDF() ((mpfr_rnd_t) (randlimb() % MPFR_RNDF))
+
/* Generates a random sign */
#define SIGN_RAND() ( (randlimb()%2) ? MPFR_SIGN_POS : MPFR_SIGN_NEG)
/* Loop for all rounding modes */
#define RND_LOOP(_r) for((_r) = 0 ; (_r) < MPFR_RND_MAX ; (_r)++)
+/* Loop for all rounding modes except RNDF (assumed to be the last one),
+ which must be excluded from tests that rely on deterministic results. */
+#define RND_LOOP_NO_RNDF(_r) for((_r) = 0 ; (_r) < MPFR_RNDF ; (_r)++)
+
/* Test whether two floating-point data have the same value,
seen as an element of the set of the floating-point data
(Level 2 in the IEEE 754-2008 standard). */