]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 2000 Andries Brouwer (aeb@cwi.nl) |
2 | .\" | |
e4a74ca8 | 3 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
4 | .\" |
5 | .\" 2000-08-14 added GNU additions from Andreas Jaeger | |
6 | .\" 2000-12-05 some changes inspired by acahalan's remarks | |
7 | .\" | |
1d767b55 | 8 | .TH FENV 3 2021-03-22 "Linux" "Linux Programmer's Manual" |
fea681da MK |
9 | .SH NAME |
10 | feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, | |
11 | fetestexcept, fegetenv, fegetround, feholdexcept, fesetround, | |
efe1a286 | 12 | fesetenv, feupdateenv, feenableexcept, fedisableexcept, |
c45bd688 | 13 | fegetexcept \- floating-point rounding and exception handling |
2af19291 AC |
14 | .SH LIBRARY |
15 | Math library | |
8fc3b2cf | 16 | .RI ( libm ", " \-lm ) |
fea681da MK |
17 | .SH SYNOPSIS |
18 | .nf | |
19 | .B #include <fenv.h> | |
68e4db0a | 20 | .PP |
fea681da | 21 | .BI "int feclearexcept(int " excepts ); |
fea681da | 22 | .BI "int fegetexceptflag(fexcept_t *" flagp ", int " excepts ); |
fea681da | 23 | .BI "int feraiseexcept(int " excepts ); |
fea681da | 24 | .BI "int fesetexceptflag(const fexcept_t *" flagp ", int " excepts ); |
fea681da | 25 | .BI "int fetestexcept(int " excepts ); |
68e4db0a | 26 | .PP |
fea681da | 27 | .B "int fegetround(void);" |
fea681da | 28 | .BI "int fesetround(int " rounding_mode ); |
68e4db0a | 29 | .PP |
fea681da | 30 | .BI "int fegetenv(fenv_t *" envp ); |
fea681da | 31 | .BI "int feholdexcept(fenv_t *" envp ); |
fea681da | 32 | .BI "int fesetenv(const fenv_t *" envp ); |
fea681da MK |
33 | .BI "int feupdateenv(const fenv_t *" envp ); |
34 | .fi | |
35 | .SH DESCRIPTION | |
36 | These eleven functions were defined in C99, and describe the handling | |
61e1aee0 | 37 | of floating-point rounding and exceptions (overflow, zero-divide, etc.). |
fea681da | 38 | .SS Exceptions |
19153d99 MK |
39 | The |
40 | .I divide-by-zero | |
41 | exception occurs when an operation on finite numbers | |
fea681da | 42 | produces infinity as exact answer. |
dd3568a1 | 43 | .PP |
19153d99 MK |
44 | The |
45 | .I overflow | |
46 | exception occurs when a result has to be represented as a | |
c45bd688 MK |
47 | floating-point number, but has (much) larger absolute value than the |
48 | largest (finite) floating-point number that is representable. | |
dd3568a1 | 49 | .PP |
19153d99 MK |
50 | The |
51 | .I underflow | |
52 | exception occurs when a result has to be represented as a | |
c45bd688 MK |
53 | floating-point number, but has smaller absolute value than the smallest |
54 | positive normalized floating-point number (and would lose much accuracy | |
fea681da | 55 | when represented as a denormalized number). |
dd3568a1 | 56 | .PP |
19153d99 MK |
57 | The |
58 | .I inexact | |
59 | exception occurs when the rounded result of an operation | |
fea681da | 60 | is not equal to the infinite precision result. |