projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Undo last commit, as it does not solve the problem entirely.
[gnulib.git]
/
tests
/
test-trunc2.c
diff --git
a/tests/test-trunc2.c
b/tests/test-trunc2.c
index
5292ff6
..
adf4e54
100644
(file)
--- a/
tests/test-trunc2.c
+++ b/
tests/test-trunc2.c
@@
-1,5
+1,5
@@
/* Test of rounding towards zero.
/* Test of rounding towards zero.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
-2008
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
@@
-26,7
+26,7
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-#include "isnan.h"
+#include "isnan
d
.h"
#define ASSERT(expr) \
do \
#define ASSERT(expr) \
do \
@@
-34,6
+34,7
@@
if (!(expr)) \
{ \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
if (!(expr)) \
{ \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+ fflush (stderr); \
abort (); \
} \
} \
abort (); \
} \
} \
@@
-103,7
+104,7
@@
trunc_reference (DOUBLE x)
static int
equal (DOUBLE x, DOUBLE y)
{
static int
equal (DOUBLE x, DOUBLE y)
{
- return (isnan
(x) ? isnan
(y) : x == y);
+ return (isnan
d (x) ? isnand
(y) : x == y);
}
/* Test whether the result for a given argument is correct. */
}
/* Test whether the result for a given argument is correct. */
@@
-113,10
+114,10
@@
correct_result_p (DOUBLE x, DOUBLE result)
return
(x >= 0
? (x < 1 ? result == L_(0.0) :
return
(x >= 0
? (x < 1 ? result == L_(0.0) :
- x - 1 < x ? result <= x && result >
x -
1 :
+ x - 1 < x ? result <= x && result >
= x - 1 && x - result <
1 :
equal (result, x))
: (x > -1 ? result == L_(0.0) :
equal (result, x))
: (x > -1 ? result == L_(0.0) :
- x + 1 > x ? result >= x && result <
x +
1 :
+ x + 1 > x ? result >= x && result <
= x + 1 && result - x <
1 :
equal (result, x)));
}
equal (result, x)));
}