From cb7feea731722efddf769793f58ba8f6b7deff3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 15 Apr 2019 15:43:57 +0300 Subject: [PATCH] crt-test: Tweak TEST_FLT_ACCURACY to not accept NAN --- test/crt-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/crt-test.c b/test/crt-test.c index edbc598..88cc38d 100644 --- a/test/crt-test.c +++ b/test/crt-test.c @@ -87,7 +87,9 @@ const char *context = ""; long double val = x; \ long double diff = fabsl(val - expect); \ tests++; \ - if (diff > accuracy) { \ + if (diff <= accuracy) { \ + /* All ok, not NAN */ \ + } else { \ fails++; \ printf("%s:%d: %s%s failed, expected %f, got %f (diff %f > %f)\n", __FILE__, __LINE__, context, #x, (double)expect, (double)val, (double)diff, (double)accuracy); \ } \