projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93a18a1
)
optimize signbit macro
author
Rich Felker
<dalias@aerifal.cx>
Sat, 31 Mar 2012 03:41:43 +0000
(23:41 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 31 Mar 2012 03:41:43 +0000
(23:41 -0400)
include/math.h
patch
|
blob
|
history
diff --git
a/include/math.h
b/include/math.h
index 8791bba807588fd93bf3279aded7bbdcebffedb3..ff62cb7cf35b70b6da677a76777d51c568dd744b 100644
(file)
--- a/
include/math.h
+++ b/
include/math.h
@@
-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)))