Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 162eee14 authored by Vincent Lefèvre's avatar Vincent Lefèvre
Browse files

mpfr_sqrt: check the exponent range; set the inexact flag (if needed).

Added generic tests (this shows that the inexact flag wasn't set).
[merged changesets: 4847, 4848, 4850]

[From SVN r4963 (branches/2.3)]
parent c24dd50c
Branches
Tags
No related merge requests found
......@@ -246,9 +246,9 @@ mpfr_sqrt (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode)
truncate: /* inexact = 0 or -1 */
MPFR_SET_EXP(r, expr);
MPFR_ASSERTN (expr >= MPFR_EMIN_MIN && expr <= MPFR_EMAX_MAX);
MPFR_EXP (r) = expr;
MPFR_TMP_FREE(marker);
return inexact;
return mpfr_check_range (r, inexact, rnd_mode);
}
......@@ -553,6 +553,10 @@ test_property2 (mp_prec_t p, mp_rnd_t r)
mpfr_clear (y);
}
#define TEST_FUNCTION test_sqrt
#define TEST_RANDOM_POS 8
#include "tgeneric.c"
int
main (void)
{
......@@ -672,6 +676,7 @@ main (void)
check4 ("72154663483843080704304789585920.0", GMP_RNDD,
"1.e2d9a51977e6d@13");
test_generic (2, 300, 15);
data_check ("data/sqrt", mpfr_sqrt, "mpfr_sqrt");
tests_end_mpfr ();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment