optimize signbit macro

This commit is contained in:
Rich Felker 2012-03-30 23:41:43 -04:00
parent 93a18a15e4
commit 4dbd94112f
1 changed files with 2 additions and 2 deletions

View File

@ -77,8 +77,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) ? (int)(__FLOAT_BITS(x)>>31) : \
sizeof(x) == sizeof(double) ? (int)(__DOUBLE_BITS(x)>>63) : \
__signbitl(x) )
#define isunordered(x,y) (isnan((x)) ? ((void)(y),1) : isnan((y)))