From 99540ae0decfb0ceea94d7a7723d59d4be762f54 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Fri, 3 Jul 2026 13:04:48 +0100 Subject: [PATCH] tidbits: use C++ cmath functions --- src/tidbits.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tidbits.cpp b/src/tidbits.cpp index 6e5da0fca7..34c1cd231f 100644 --- a/src/tidbits.cpp +++ b/src/tidbits.cpp @@ -1625,7 +1625,8 @@ int coin_isinf(double value) { #ifdef HAVE_ISINF - return isinf(value); + if (std::isinf(value)) { return std::signbit(value) ? -1 : 1; } + return 0; #elif defined(HAVE_FPCLASS) if (fpclass(value) == FP_NINF) { return -1; } if (fpclass(value) == FP_PINF) { return +1; } @@ -1653,7 +1654,7 @@ int coin_isnan(double value) { #ifdef HAVE_ISNAN - return isnan(value); + return std::isnan(value) ? 1 : 0; #elif defined(HAVE__ISNAN) return _isnan(value); #elif defined(HAVE_FPCLASS)