diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-02-04 14:20:46 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-02-04 14:20:46 +0000 |
commit | 830a678f69eb0bf6f8b0696231fc769c4538e89d (patch) | |
tree | 300ebd73a77726bce6aac9766e46c18faf167f68 /tests/tcompound.c | |
parent | 2af0e13163a6767d9584612d99fb8360520dd875 (diff) | |
download | mpfr-830a678f69eb0bf6f8b0696231fc769c4538e89d.tar.gz |
compound(NaN,0) is 1
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14359 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcompound.c')
-rw-r--r-- | tests/tcompound.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/tcompound.c b/tests/tcompound.c index 3ac18ceaa..7c41af0aa 100644 --- a/tests/tcompound.c +++ b/tests/tcompound.c @@ -55,13 +55,15 @@ check_ieee754 (void) exit (1); } - /* compound(x,0) = 1 for x >= -1 or x = qNaN */ - for (i = -1; i <= 2; i++) + /* compound(x,0) = 1 for x >= -1 or x = NaN */ + for (i = -2; i <= 2; i++) { - if (i != 2) - mpfr_set_si (x, i, MPFR_RNDN); - else + if (i == -2) + mpfr_set_nan (x); + else if (i == 2) mpfr_set_inf (x, 1); + else + mpfr_set_si (x, i, MPFR_RNDN); mpfr_compound (y, x, 0, MPFR_RNDN); if (mpfr_cmp_ui (y, 1) != 0) { |