]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/signbit.3
e07a3da367f1f1b8ec36f23473c142ff3da1060f
[thirdparty/man-pages.git] / man3 / signbit.3
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
12 Compile with -std=c99; link with \-lm.
13 .SH DESCRIPTION
14 `signbit' is a generic macro which can work on all real floating-point
15 types. It returns a nonzero value if the value of X has its sign
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,
20 but `signbit (-0.0)' will return a nonzero value.
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)