+static int ignore_nl, ignore_trailing_nl, ignore_case;
+static int real_mode;
+static double rel_eps = 1e-5;
+static double abs_eps = 1e-30;
+
+static int tokens_equal(struct tokenizer *t1, struct tokenizer *t2)
+{
+ if (real_mode)
+ {
+ double x1, x2;
+ if (to_double(t1, &x1) && to_double(t2, &x2))
+ {
+ if (x1 == x2)
+ return 1;
+ double eps = fabs(x2 * rel_eps);
+ if (eps < abs_eps)
+ eps = abs_eps;
+ return (fabs(x1-x2) <= eps);
+ }
+ // If they fail to convert, compare them as strings.
+ }
+ return !(ignore_case ? strcasecmp : strcmp)(t1->token, t2->token);
+}
+