]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fenv.3
system.3: wfix
[thirdparty/man-pages.git] / man3 / fenv.3
CommitLineData
fea681da
MK
1.\" Copyright (c) 2000 Andries Brouwer (aeb@cwi.nl)
2.\"
1dd72f9c 3.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
fea681da
MK
4.\" This is free documentation; you can redistribute it and/or
5.\" modify it under the terms of the GNU General Public License as
6.\" published by the Free Software Foundation; either version 2 of
7.\" the License, or (at your option) any later version.
8.\"
9.\" The GNU General Public License's references to "object code"
10.\" and "executables" are to be interpreted as the output of any
11.\" document formatting or typesetting system, including
12.\" intermediate and printed output.
13.\"
14.\" This manual is distributed in the hope that it will be useful,
15.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.\" GNU General Public License for more details.
18.\"
19.\" You should have received a copy of the GNU General Public
c715f741
MK
20.\" License along with this manual; if not, see
21.\" <http://www.gnu.org/licenses/>.
6a8d8745 22.\" %%%LICENSE_END
fea681da
MK
23.\"
24.\" 2000-08-14 added GNU additions from Andreas Jaeger
25.\" 2000-12-05 some changes inspired by acahalan's remarks
26.\"
4b8c67d9 27.TH FENV 3 2017-09-15 "Linux" "Linux Programmer's Manual"
fea681da
MK
28.SH NAME
29feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag,
30fetestexcept, fegetenv, fegetround, feholdexcept, fesetround,
efe1a286 31fesetenv, feupdateenv, feenableexcept, fedisableexcept,
c45bd688 32fegetexcept \- floating-point rounding and exception handling
fea681da
MK
33.SH SYNOPSIS
34.nf
35.B #include <fenv.h>
68e4db0a 36.PP
fea681da 37.BI "int feclearexcept(int " excepts );
fea681da 38.BI "int fegetexceptflag(fexcept_t *" flagp ", int " excepts );
fea681da 39.BI "int feraiseexcept(int " excepts );
fea681da 40.BI "int fesetexceptflag(const fexcept_t *" flagp ", int " excepts );
fea681da 41.BI "int fetestexcept(int " excepts );
68e4db0a 42.PP
fea681da 43.B "int fegetround(void);"
fea681da 44.BI "int fesetround(int " rounding_mode );
68e4db0a 45.PP
fea681da 46.BI "int fegetenv(fenv_t *" envp );
fea681da 47.BI "int feholdexcept(fenv_t *" envp );
fea681da 48.BI "int fesetenv(const fenv_t *" envp );
fea681da
MK
49.BI "int feupdateenv(const fenv_t *" envp );
50.fi
68e4db0a 51.PP
9f18660d 52Link with \fI\-lm\fP.
fea681da
MK
53.SH DESCRIPTION
54These eleven functions were defined in C99, and describe the handling
61e1aee0 55of floating-point rounding and exceptions (overflow, zero-divide, etc.).
fea681da 56.SS Exceptions
19153d99
MK
57The
58.I divide-by-zero
59exception occurs when an operation on finite numbers
fea681da 60produces infinity as exact answer.
dd3568a1 61.PP
19153d99
MK
62The
63.I overflow
64exception occurs when a result has to be represented as a
c45bd688
MK
65floating-point number, but has (much) larger absolute value than the
66largest (finite) floating-point number that is representable.
dd3568a1 67.PP
19153d99
MK
68The
69.I underflow
70exception occurs when a result has to be represented as a
c45bd688
MK
71floating-point number, but has smaller absolute value than the smallest
72positive normalized floating-point number (and would lose much accuracy
fea681da 73when represented as a denormalized number).
dd3568a1 74.PP
19153d99
MK
75The
76.I inexact
77exception occurs when the rounded result of an operation
fea681da 78is not equal to the infinite precision result.