projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
autoupdate
[gnulib.git]
/
tests
/
test-floor-ieee.c
diff --git
a/tests/test-floor-ieee.c
b/tests/test-floor-ieee.c
index
0051d67
..
d7671a1
100644
(file)
--- a/
tests/test-floor-ieee.c
+++ b/
tests/test-floor-ieee.c
@@
-1,5
+1,5
@@
/* Test of rounding towards negative infinity.
/* Test of rounding towards negative 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
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 ()
{
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 (floor (0.0)));
ASSERT (!!signbit (floor (minus_zerod)) == !!signbit (minus_zerod));
/* Zero. */
ASSERT (!signbit (floor (0.0)));
ASSERT (!!signbit (floor (minus_zerod)) == !!signbit (minus_zerod));
+ /* Positive numbers. */
+ ASSERT (!signbit (floor (0.3)));
+ ASSERT (!signbit (floor (0.7)));
+ /* Negative numbers. */
+ ASSERT (!!signbit (floor (-0.3)) == !!signbit (minus_zerod));
+ ASSERT (!!signbit (floor (-0.7)) == !!signbit (minus_zerod));
return 0;
}
return 0;
}