From fcd82d3dc36a44c20b569210bea6e981609bcd9e Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 8 Apr 2023 12:29:19 -0400 Subject: [PATCH] math.h: Change definition of FP_ILOGB0 to match the specification. See #18351 for details on the specifications. This is the same thing NetBSD does. BeOS R5 defined these values differently than we did even before this commit, and it does not seem to have caused problems then, so this should be fine. While technically an ABI break, in practice these values are not always differentiated on other platforms, and it appears musl's code triggers divide-by-zero exceptions on purpose before it returns this value, anyway. Fixes #18351. --- headers/posix/math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/posix/math.h b/headers/posix/math.h index a4bb33ef1f..dc3670ae7e 100644 --- a/headers/posix/math.h +++ b/headers/posix/math.h @@ -94,7 +94,7 @@ #define FP_FAST_FMAL 0 #endif -#define FP_ILOGB0 INT_MAX +#define FP_ILOGB0 INT_MIN #define FP_ILOGBNAN INT_MAX #ifdef __cplusplus