]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2 | .\" Distributed under GPL | |
3 | .\" Based on glibc infopages | |
4 | .TH SIGNBIT 3 2002-08-10 "GNU" "libc math functions" | |
5 | .SH NAME | |
6 | signbit \- test sign of a real floating point number | |
7 | .SH SYNOPSIS | |
8 | .B "#include <math.h>" | |
9 | .sp | |
10 | .BI "int signbit (" X ");" | |
11 | .sp | |
462a7bad | 12 | Compile with -std=c99; link with \-lm. |
fea681da MK |
13 | .SH DESCRIPTION |
14 | `signbit' is a generic macro which can work on all real floating-point | |
f59a3f19 | 15 | types. It returns a non-zero value if the value of X has its sign |
fea681da MK |
16 | bit set. |
17 | .PP | |
18 | This is not the same as `x < 0.0', because IEEE 754 floating point | |
19 | allows zero to be signed. The comparison `-0.0 < 0.0' is false, | |
f59a3f19 | 20 | but `signbit (-0.0)' will return a non-zero value. |
fea681da MK |
21 | .SH "CONFORMING TO" |
22 | This function is defined in IEC 559 (and the appendix with | |
23 | recommended functions in IEEE 754/IEEE 854). | |
24 | .SH "SEE ALSO" | |
25 | .BR copysign (3) |