]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/signbit.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / signbit.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
4 .\"
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
6 .\"
7 .\" Based on glibc infopages, copyright Free Software Foundation
8 .\"
9 .TH SIGNBIT 3 2021-03-22 "Linux man-pages (unreleased)"
10 .SH NAME
11 signbit \- test sign of a real floating-point number
12 .SH LIBRARY
13 Math library
14 .RI ( libm ", " \-lm )
15 .SH SYNOPSIS
16 .nf
17 .B "#include <math.h>"
18 .PP
19 .BI "int signbit(" x ");"
20 .fi
21 .PP
22 .RS -4
23 Feature Test Macro Requirements for glibc (see
24 .BR feature_test_macros (7)):
25 .RE
26 .PP
27 .BR signbit ():
28 .nf
29 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
30 .fi
31 .SH DESCRIPTION
32 .BR signbit ()
33 is a generic macro which can work on all real floating-point types.
34 It returns a nonzero value if the value of
35 .I x
36 has its sign bit set.
37 .PP
38 This is not the same as
39 .IR "x < 0.0" ,
40 because IEEE 754 floating point allows zero to be signed.
41 The comparison
42 .I \-0.0\~<\~0.0
43 is false, but
44 .I signbit(\-0.0)
45 will return a nonzero value.
46 .PP
47 NaNs and infinities have a sign bit.
48 .SH RETURN VALUE
49 The
50 .BR signbit ()
51 macro returns nonzero if the sign of
52 .I x
53 is negative; otherwise it returns zero.
54 .SH ERRORS
55 No errors occur.
56 .SH ATTRIBUTES
57 For an explanation of the terms used in this section, see
58 .BR attributes (7).
59 .ad l
60 .nh
61 .TS
62 allbox;
63 lbx lb lb
64 l l l.
65 Interface Attribute Value
66 T{
67 .BR signbit ()
68 T} Thread safety MT-Safe
69 .TE
70 .hy
71 .ad
72 .sp 1
73 .SH STANDARDS
74 POSIX.1-2001, POSIX.1-2008, C99.
75 This function is defined in IEC 559 (and the appendix with
76 recommended functions in IEEE 754/IEEE 854).
77 .SH SEE ALSO
78 .BR copysign (3)