From 9f99261a6362d75b86e5d63ecef82d4ce8b35534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Osztrogon=C3=A1c?= Date: Tue, 3 Jun 2025 15:52:03 +0200 Subject: [PATCH] Fix "floating-point comparison is always false" clang error in jerry-math MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu --- jerry-math/include/math.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jerry-math/include/math.h b/jerry-math/include/math.h index 23b5148da4..188ee88025 100644 --- a/jerry-math/include/math.h +++ b/jerry-math/include/math.h @@ -22,11 +22,11 @@ extern "C" { /* General Constants. */ #ifdef _MSC_VER -#define INFINITY ((float) (1e+300 * 1e+300)) /* 1e+300*1e+300 must overflow */ -#define NAN ((float) (INFINITY * 0.0f)) +#define INFINITY ((double) (1e+300 * 1e+300)) /* 1e+300*1e+300 must overflow */ +#define NAN ((double) (INFINITY * 0.0f)) #else /* !_MSC_VER */ -#define INFINITY ((float) (1.0 / 0.0)) -#define NAN ((float) (0.0 / 0.0)) +#define INFINITY ((double) (1.0 / 0.0)) +#define NAN ((double) (0.0 / 0.0)) #endif /* _MSC_VER */ #define HUGE_VAL ((double) INFINITY)