Permalink
Browse files

use the absolute value to check the test result against an epsilon

  • Loading branch information...
1 parent ede96e4 commit 2fbdb0f231cafdb77b025d3cd8afe90cda99b3ba @bivab bivab committed Mar 25, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 testsuite/libffi.call/many.c
@@ -7,7 +7,9 @@
/* { dg-do run } */
#include "ffitest.h"
+#include <stdlib.h>
#include <float.h>
+#include <math.h>
static float many(float f1,
float f2,
@@ -62,7 +64,7 @@ int main (void)
fa[8], fa[9],
fa[10],fa[11],fa[12]);
- if (f - ff < FLT_EPSILON)
+ if (fabs(f - ff) < FLT_EPSILON)
exit(0);
else
abort();

0 comments on commit 2fbdb0f

Please sign in to comment.