]>
Commit | Line | Data |
---|---|---|
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 | .\" | |
fe0fefbf | 27 | .TH FENV 3 2015-03-02 "Linux" "Linux Programmer's Manual" |
fea681da MK |
28 | .SH NAME |
29 | feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, | |
30 | fetestexcept, fegetenv, fegetround, feholdexcept, fesetround, | |
efe1a286 | 31 | fesetenv, feupdateenv, feenableexcept, fedisableexcept, |
c45bd688 | 32 | fegetexcept \- floating-point rounding and exception handling |
fea681da MK |
33 | .SH SYNOPSIS |
34 | .nf | |
35 | .B #include <fenv.h> | |
36 | .sp | |
37 | .BI "int feclearexcept(int " excepts ); | |
38 | .br | |
39 | .BI "int fegetexceptflag(fexcept_t *" flagp ", int " excepts ); | |
40 | .br | |
41 | .BI "int feraiseexcept(int " excepts ); | |
42 | .br | |
43 | .BI "int fesetexceptflag(const fexcept_t *" flagp ", int " excepts ); | |
44 | .br | |
45 | .BI "int fetestexcept(int " excepts ); | |
46 | .sp | |
47 | .B "int fegetround(void);" | |
48 | .br | |
49 | .BI "int fesetround(int " rounding_mode ); | |
50 | .sp | |
51 | .BI "int fegetenv(fenv_t *" envp ); | |
52 | .br | |
53 | .BI "int feholdexcept(fenv_t *" envp ); | |
54 | .br | |
55 | .BI "int fesetenv(const fenv_t *" envp ); | |
56 | .br | |
57 | .BI "int feupdateenv(const fenv_t *" envp ); | |
58 | .fi | |
9f18660d MK |
59 | .sp |
60 | Link with \fI\-lm\fP. | |
fea681da MK |
61 | .SH DESCRIPTION |
62 | These eleven functions were defined in C99, and describe the handling | |
61e1aee0 | 63 | of floating-point rounding and exceptions (overflow, zero-divide, etc.). |
fea681da | 64 | .SS Exceptions |
19153d99 MK |
65 | The |
66 | .I divide-by-zero | |
67 | exception occurs when an operation on finite numbers | |
fea681da MK |
68 | produces infinity as exact answer. |
69 | .LP | |
19153d99 MK |
70 | The |
71 | .I overflow | |
72 | exception occurs when a result has to be represented as a | |
c45bd688 MK |
73 | floating-point number, but has (much) larger absolute value than the |
74 | largest (finite) floating-point number that is representable. | |
fea681da | 75 | .LP |
19153d99 MK |
76 | The |
77 | .I underflow | |
78 | exception occurs when a result has to be represented as a | |
c45bd688 MK |
79 | floating-point number, but has smaller absolute value than the smallest |
80 | positive normalized floating-point number (and would lose much accuracy | |
fea681da MK |
81 | when represented as a denormalized number). |
82 | .LP | |
19153d99 MK |
83 | The |
84 | .I inexact | |
85 | exception occurs when the rounded result of an operation | |
fea681da | 86 | is not equal to the infinite precision result. |