From 21d0f5c85063b4e1f8168fc53fb4238d78375f08 Mon Sep 17 00:00:00 2001 From: nsz Date: Tue, 6 Mar 2012 19:17:42 +0100 Subject: [PATCH] add !! to signbit macro so the return type is not uint64_t --- include/math.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/math.h b/include/math.h index 19097a5..f320b8e 100644 --- a/include/math.h +++ b/include/math.h @@ -74,8 +74,8 @@ int __signbitf(float); int __signbitl(long double); #define signbit(x) ( \ - sizeof(x) == sizeof(float) ? __FLOAT_BITS(x) & 0x80000000 : \ - sizeof(x) == sizeof(double) ? __DOUBLE_BITS(x) & (__uint64_t)1<<63 : \ + sizeof(x) == sizeof(float) ? !!(__FLOAT_BITS(x) & 0x80000000) : \ + sizeof(x) == sizeof(double) ? !!(__DOUBLE_BITS(x) & (__uint64_t)1<<63) : \ __signbitl(x) ) #define isunordered(x,y) (isnan((x)) ? ((void)(y),1) : isnan((y))) -- 2.20.1