summaryrefslogtreecommitdiff
path: root/src/tests/test_strtod_nol.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test_strtod_nol.c')
-rw-r--r--src/tests/test_strtod_nol.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/test_strtod_nol.c b/src/tests/test_strtod_nol.c
index 0be798c..8e5c524 100644
--- a/src/tests/test_strtod_nol.c
+++ b/src/tests/test_strtod_nol.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <math.h>
#include "strutils.h"
struct strtod_tests {
@@ -25,6 +26,11 @@ struct strtod_tests tests[] = {
{NULL, 0.0}
};
+#define EPSILON 1.0 // Really not trying for precision here
+int dequal(const double d1, const double d2)
+{
+ return fabs(d1-d2) < EPSILON;
+}
int main(int argc, char *argv[])