1SIGNBIT(3) libc math functions SIGNBIT(3)
2
3
4
6 signbit - test sign of a real floating point number
7
9 #include <math.h>
10
11 int signbit (X);
12
13 Compile with -std=c99; link with -lm.
14
16 `signbit' is a generic macro which can work on all real floating-point
17 types. It returns a non-zero value if the value of X has its sign bit
18 set.
19
20 This is not the same as `x < 0.0', because IEEE 754 floating point
21 allows zero to be signed. The comparison `-0.0 < 0.0' is false, but
22 `signbit (-0.0)' will return a non-zero value.
23
25 C99. This function is defined in IEC 559 (and the appendix with recom‐
26 mended functions in IEEE 754/IEEE 854).
27
29 copysign(3)
30
31
32
33GNU 2002-08-10 SIGNBIT(3)