X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-printf-frexp.c;h=d1b0d846f73ebecb12ec845f67ddb270464b1052;hb=66a236773eb7d9706db907339c65791355083a3d;hp=9465c2009b320de4434ec8ed1d9b54e751ddfb75;hpb=973c0665ffa8d014c50b2c9b808d437c69fb5c50;p=gnulib.git diff --git a/tests/test-printf-frexp.c b/tests/test-printf-frexp.c index 9465c2009..d1b0d846f 100644 --- a/tests/test-printf-frexp.c +++ b/tests/test-printf-frexp.c @@ -1,10 +1,10 @@ /* Test of splitting a double into fraction and mantissa. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2011 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + 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 - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Bruno Haible , 2007. */ @@ -22,9 +21,8 @@ #include "printf-frexp.h" #include -#include -#define ASSERT(expr) if (!(expr)) abort (); +#include "macros.h" static double my_ldexp (double x, int d) @@ -40,7 +38,12 @@ int main () { int i; - double x; + /* The use of 'volatile' guarantees that excess precision bits are dropped + when dealing with denormalized numbers. It is necessary on x86 systems + where double-floats are not IEEE compliant by default, to avoid that the + results become platform and compiler option dependent. 'volatile' is a + portable alternative to gcc's -ffloat-store option. */ + volatile double x; for (i = 1, x = 1.0; i <= DBL_MAX_EXP; i++, x *= 2.0) {