diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-08-03 10:57:20 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-08-03 10:57:20 +0000 |
commit | 10ab947ef47dbe98e3b73ca443e9bc3afc331000 (patch) | |
tree | 291fd6b20544277aad84a55f5ab5d3b055bc03ab | |
parent | d4481bfaad6ca4e911cd90a9f97c54962000e200 (diff) | |
download | mpfr-10ab947ef47dbe98e3b73ca443e9bc3afc331000.tar.gz |
[tests/tget_flt.c] Portability correction.
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14553 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | tests/tget_flt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/tget_flt.c b/tests/tget_flt.c index b85e74b68..4eac79645 100644 --- a/tests/tget_flt.c +++ b/tests/tget_flt.c @@ -21,7 +21,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <float.h> /* for FLT_MIN */ -#include <math.h> /* for isnan */ #include "mpfr-test.h" #include "ieee_floats.h" @@ -52,19 +51,22 @@ equal_flt (float f, float g) static void bug_icx (void) { +#if __MPFR_STDC (199901L) mpfr_t x; float y; + mpfr_init2 (x, 24); mpfr_set_flt (x, -0x1p-149f, MPFR_RNDN); mpfr_log (x, x, MPFR_RNDN); y = mpfr_get_flt (x, MPFR_RNDN); - if (!isnan (y)) + if (!DOUBLE_ISNAN (y)) { printf ("Error, mpfr_get_flt(NaN) != NaN\n"); - printf ("got %a\n", y); + printf ("got %a\n", (double) y); exit (1); } mpfr_clear (x); +#endif } int |