projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a warning in last patch.
[gnulib.git]
/
tests
/
test-frexp.c
diff --git
a/tests/test-frexp.c
b/tests/test-frexp.c
index
96c640f
..
9ce989b
100644
(file)
--- a/
tests/test-frexp.c
+++ b/
tests/test-frexp.c
@@
-22,11
+22,21
@@
#include <math.h>
#include <float.h>
#include <math.h>
#include <float.h>
+#include <stdio.h>
#include <stdlib.h>
#include "isnan.h"
#include <stdlib.h>
#include "isnan.h"
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+ do \
+ { \
+ if (!(expr)) \
+ { \
+ fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+ abort (); \
+ } \
+ } \
+ while (0)
/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
#ifdef __DECC
/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
#ifdef __DECC
@@
-92,6
+102,7
@@
main ()
mantissa = frexp (x, &exp);
ASSERT (exp == 0);
ASSERT (mantissa == x);
mantissa = frexp (x, &exp);
ASSERT (exp == 0);
ASSERT (mantissa == x);
+ ASSERT (!signbit (mantissa));
}
{ /* Negative zero. */
}
{ /* Negative zero. */
@@
-101,6
+112,7
@@
main ()
mantissa = frexp (x, &exp);
ASSERT (exp == 0);
ASSERT (mantissa == x);
mantissa = frexp (x, &exp);
ASSERT (exp == 0);
ASSERT (mantissa == x);
+ ASSERT (signbit (mantissa));
}
for (i = 1, x = 1.0; i <= DBL_MAX_EXP; i++, x *= 2.0)
}
for (i = 1, x = 1.0; i <= DBL_MAX_EXP; i++, x *= 2.0)