X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-ldexp.c;h=93574531d7d87de149123519d833904ae35e2cb8;hb=23eecb48e39afd0d267d64d40ba6bf97aa865e13;hp=9eb6e5e32e47092226d130b0b6c6f97fd2e9d948;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/tests/test-ldexp.c b/tests/test-ldexp.c index 9eb6e5e32..93574531d 100644 --- a/tests/test-ldexp.c +++ b/tests/test-ldexp.c @@ -1,5 +1,5 @@ /* Test of ldexp() function. - Copyright (C) 2010-2011 Free Software Foundation, Inc. + Copyright (C) 2007-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -/* Written by Bruno Haible , 2010. */ +/* Written by Bruno Haible , 2007, 2010. */ #include @@ -23,26 +23,33 @@ #include "signature.h" SIGNATURE_CHECK (ldexp, double, (double, int)); +#include + +#include "isnand-nolibm.h" +#include "minus-zero.h" +#include "infinity.h" +#include "nan.h" #include "macros.h" -volatile double x; -double y; +#undef INFINITY +#undef NAN + +#define DOUBLE double +#define ISNAN isnand +#define INFINITY Infinityd () +#define NAN NaNd () +#define L_(literal) literal +#define MINUS_ZERO minus_zerod +#define MIN_EXP DBL_MIN_EXP +#define MAX_EXP DBL_MAX_EXP +#define LDEXP ldexp +#define RANDOM randomd +#include "test-ldexp.h" int main () { - /* A particular value. */ - x = 0.6; - y = ldexp (x, 0); - ASSERT (y >= 0.5999999999 && y <= 0.6000000001); - - x = 0.6; - y = ldexp (x, 1); - ASSERT (y >= 1.199999999 && y <= 1.200000001); - - x = 0.6; - y = ldexp (x, -1); - ASSERT (y >= 0.2999999999 && y <= 0.3000000001); + test_function (); return 0; }