--- parser3/src/include/pa_int.h 2026/01/07 18:58:26 1.5 +++ parser3/src/include/pa_int.h 2026/09/15 20:48:14 1.7 @@ -1,14 +1,14 @@ /** @file Parser: pa_int and support functions decls. - Copyright (c) 2001-2026 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_INT_H #define PA_INT_H -#define IDENT_PA_INT_H "$Id: pa_int.h,v 1.5 2026/01/07 18:58:26 moko Exp $" +#define IDENT_PA_INT_H "$Id: pa_int.h,v 1.7 2026/09/15 20:48:14 moko Exp $" // includes @@ -95,4 +95,8 @@ uint64_t pa_atoul(const char *str, int b const char* format_double(double value, const char *fmt); +// comparing doubles with exact == is unreliable - compare by ULP-distance instead. +#define ULP_EQ_DEFAULT_DIST 3 +bool ulp_eq_double(double a, double b, uint64_t max_ulp=ULP_EQ_DEFAULT_DIST); + #endif