]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fenv.3
Many pages: Fix style issues reported by `make lint-groff`
[thirdparty/man-pages.git] / man3 / fenv.3
CommitLineData
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
10feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag,
11fetestexcept, fegetenv, fegetround, feholdexcept, fesetround,
efe1a286 12fesetenv, feupdateenv, feenableexcept, fedisableexcept,
c45bd688 13fegetexcept \- floating-point rounding and exception handling
2af19291
AC
14.SH LIBRARY
15Math 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
36These eleven functions were defined in C99, and describe the handling
61e1aee0 37of floating-point rounding and exceptions (overflow, zero-divide, etc.).
fea681da 38.SS Exceptions
19153d99
MK
39The
40.I divide-by-zero
41exception occurs when an operation on finite numbers
fea681da 42produces infinity as exact answer.
dd3568a1 43.PP
19153d99
MK
44The
45.I overflow
46exception occurs when a result has to be represented as a
c45bd688
MK
47floating-point number, but has (much) larger absolute value than the
48largest (finite) floating-point number that is representable.
dd3568a1 49.PP
19153d99
MK
50The
51.I underflow
52exception occurs when a result has to be represented as a
c45bd688
MK
53floating-point number, but has smaller absolute value than the smallest
54positive normalized floating-point number (and would lose much accuracy
fea681da 55when represented as a denormalized number).
dd3568a1 56.PP
19153d99
MK
57The
58.I inexact
59exception occurs when the rounded result of an operation
fea681da 60is not equal to the infinite precision result.