]>
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 | .\" | |
4b8c67d9 | 27 | .TH FENV 3 2017-09-15 "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> | |
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 | 52 | Link with \fI\-lm\fP. |
fea681da MK |
53 | .SH DESCRIPTION |
54 | These eleven functions were defined in C99, and describe the handling | |
61e1aee0 | 55 | of floating-point rounding and exceptions (overflow, zero-divide, etc.). |
fea681da | 56 | .SS Exceptions |
19153d99 MK |
57 | The |
58 | .I divide-by-zero | |
59 | exception occurs when an operation on finite numbers | |
fea681da | 60 | produces infinity as exact answer. |
dd3568a1 | 61 | .PP |
19153d99 MK |
62 | The |
63 | .I overflow | |
64 | exception occurs when a result has to be represented as a | |
c45bd688 MK |
65 | floating-point number, but has (much) larger absolute value than the |
66 | largest (finite) floating-point number that is representable. | |
dd3568a1 | 67 | .PP |
19153d99 MK |
68 | The |
69 | .I underflow | |
70 | exception occurs when a result has to be represented as a | |
c45bd688 MK |
71 | floating-point number, but has smaller absolute value than the smallest |
72 | positive normalized floating-point number (and would lose much accuracy | |
fea681da | 73 | when represented as a denormalized number). |
dd3568a1 | 74 | .PP |
19153d99 MK |
75 | The |
76 | .I inexact | |
77 | exception occurs when the rounded result of an operation | |
fea681da | 78 | is not equal to the infinite precision result. |