X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-ceil-ieee.c;h=38dd613cd291bf4e15fd8a0d0d1a77d1d4da38a9;hb=b12df021ba5b5f12648d84f91d021777c347e9be;hp=06cfeff9e04db0e51284d5162c62038c2d29afab;hpb=4b7ece979775e13ba4f1db1e6d9cfe400eff0f01;p=gnulib.git diff --git a/tests/test-ceil-ieee.c b/tests/test-ceil-ieee.c index 06cfeff9e..38dd613cd 100644 --- a/tests/test-ceil-ieee.c +++ b/tests/test-ceil-ieee.c @@ -1,5 +1,5 @@ /* Test of rounding towards positive infinity. - Copyright (C) 2010 Free Software Foundation, Inc. + Copyright (C) 2010-2011 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 @@ -24,9 +24,20 @@ int main () { + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + /* Zero. */ ASSERT (!signbit (ceil (0.0))); ASSERT (!!signbit (ceil (minus_zerod)) == !!signbit (minus_zerod)); + /* Positive numbers. */ + ASSERT (!signbit (ceil (0.3))); + ASSERT (!signbit (ceil (0.7))); + /* Negative numbers. */ + ASSERT (!!signbit (ceil (-0.3)) == !!signbit (minus_zerod)); + ASSERT (!!signbit (ceil (-0.7)) == !!signbit (minus_zerod)); return 0; }