From 30c873fbfb9bb291330d50aae8fb67d774a0e4f8 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Tue, 16 Dec 2014 20:36:40 +0100 Subject: [PATCH] test-json: use fabs --- src/test/test-json.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/test-json.c b/src/test/test-json.c index 8777cf7a4..00768358b 100644 --- a/src/test/test-json.c +++ b/src/test/test-json.c @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#include + #include "log.h" #include "util.h" #include "json.h" @@ -52,7 +54,7 @@ static void test_one(const char *data, ...) { double d; d = va_arg(ap, double); - assert_se(abs(d - v.real) < 0.001); + assert_se(fabs(d - v.real) < 0.001); } else if (t == JSON_INTEGER) { intmax_t i; -- 2.30.2