File: signbit.3

package info (click to toggle)
manpages 3.05-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 10,852 kB
  • ctags: 10
  • sloc: sh: 389; perl: 164; makefile: 80; lisp: 22
file content (42 lines) | stat: -rw-r--r-- 1,108 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.\" Based on glibc infopages
.TH SIGNBIT 3 2002-08-10 "GNU" "Linux Programmer's Manual"
.SH NAME
signbit \- test sign of a real floating point number
.SH SYNOPSIS
.B "#include <math.h>"
.sp
.BI  "int signbit(" x ");"
.sp
Compile with \fI\-std=c99\fP; link with \fI\-lm\fP.
.SH DESCRIPTION
.BR signbit ()
is a generic macro which can work on all real floating-point types.
It returns a non-zero value if the value of
.I x
has its sign bit set.
.PP
This is not the same as
.IR "x < 0.0" ,
because IEEE 754 floating point
allows zero to be signed.
The comparison
.IR "-0.0 < 0.0"
is false, but
.IR "signbit(\-0.0)"
will return a non-zero value.
.SH "CONFORMING TO"
C99.
This function is defined in IEC 559 (and the appendix with
recommended functions in IEEE 754/IEEE 854).
.SH "SEE ALSO"
.BR copysign (3)
.SH COLOPHON
This page is part of release 3.05 of the Linux
.I man-pages
project.
A description of the project,
and information about reporting bugs,
can be found at
http://www.kernel.org/doc/man-pages/.