tests: runtime: out_lib: add missing fabs
#include <fluent-bit/flb_compat.h>
#include <fluent-bit/flb_time.h>
#include <float.h>
+#include <math.h>
#include "flb_tests_runtime.h"
struct test_ctx {
@@ -162,7 +163,7 @@ static int msgpack_strncmp(char* str, size_t str_len, msgpack_object obj)
case MSGPACK_OBJECT_FLOAT64:
{
double val = strtod(str, NULL);
- if ((val - obj.via.f64) < DBL_EPSILON) {
+ if (fabs(val - obj.via.f64) < DBL_EPSILON) {
ret = 0;
}
}
