Fix floating point number comparisons in testsuite/libffi.call/float[123].c.
Rewrite the checks for approximate equality of floating point return values to be in the form "fabs(a - b) < EPS" instead of just "a - b < EPS".
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include "ffitest.h"
|
||||
#include "float.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
typedef union
|
||||
{
|
||||
double d;
|
||||
@@ -47,7 +49,7 @@ int main (void)
|
||||
|
||||
/* These are not always the same!! Check for a reasonable delta */
|
||||
|
||||
CHECK(result[0].d - dblit(f) < DBL_EPSILON);
|
||||
CHECK(fabs(result[0].d - dblit(f)) < DBL_EPSILON);
|
||||
|
||||
/* Check the canary. */
|
||||
for (i = 0; i < sizeof (double); ++i)
|
||||
|
||||
Reference in New Issue
Block a user