X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-math.c;h=aa51f8581a3890389bfeea4c9d2461c6d611908f;hb=5e40996ccdb9e2f9398ecd7eccdf477b8e770461;hp=5c00581d17c8bef64f8df346443d8d9d3156714f;hpb=06945b7c073c0872ec2049c0e0b94f789bf8d77e;p=gnulib.git diff --git a/tests/test-math.c b/tests/test-math.c index 5c00581d1..aa51f8581 100644 --- a/tests/test-math.c +++ b/tests/test-math.c @@ -25,9 +25,29 @@ choke me #endif +#if 0 +/* Check that NAN expands into a constant expression. */ +static float n = NAN; +#endif + +/* Compare two numbers with ==. + This is a separate function because IRIX 6.5 "cc -O" miscompiles an + 'x == x' test. */ +static int +numeric_equal (double x, double y) +{ + return x == y; +} + int main () { double d = NAN; - return d == d; + double zero = 0.0; + if (numeric_equal (d, d)) + return 1; + d = HUGE_VAL; + if (!numeric_equal (d, 1.0 / zero)) + return 1; + return 0; }