]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gcc/c-implementation-defined-behavior/floating-point.rst
Revert "sphinx: add missing trailing newline"
[thirdparty/gcc.git] / gcc / doc / gcc / c-implementation-defined-behavior / floating-point.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. _floating-point-implementation:
7
8Floating Point
9**************
10
11* The accuracy of the floating-point operations and of the library
12 functions in ``<math.h>`` and ``<complex.h>`` that return floating-point
13 results (C90, C99 and C11 5.2.4.2.2).
14
15 The accuracy is unknown.
16
17* The rounding behaviors characterized by non-standard values
18 of ``FLT_ROUNDS``
19 (C90, C99 and C11 5.2.4.2.2).
20
21 GCC does not use such values.
22
23* The evaluation methods characterized by non-standard negative
24 values of ``FLT_EVAL_METHOD`` (C99 and C11 5.2.4.2.2).
25
26 GCC does not use such values.
27
28* The direction of rounding when an integer is converted to a
29 floating-point number that cannot exactly represent the original
30 value (C90 6.2.1.3, C99 and C11 6.3.1.4).
31
32 C99 Annex F is followed.
33
34* The direction of rounding when a floating-point number is
35 converted to a narrower floating-point number (C90 6.2.1.4, C99 and C11
36 6.3.1.5).
37
38 C99 Annex F is followed.
39
40* How the nearest representable value or the larger or smaller
41 representable value immediately adjacent to the nearest representable
42 value is chosen for certain floating constants (C90 6.1.3.1, C99 and C11
43 6.4.4.2).
44
45 C99 Annex F is followed.
46
47* Whether and how floating expressions are contracted when not
48 disallowed by the ``FP_CONTRACT`` pragma (C99 and C11 6.5).
49
50 Expressions are currently only contracted if :option:`-ffp-contract=fast`,
51 :option:`-funsafe-math-optimizations` or :option:`-ffast-math` are used.
52 This is subject to change.
53
54* The default state for the ``FENV_ACCESS`` pragma (C99 and C11
55 7.6.1).
56
57 This pragma is not implemented, but the default is to 'off' unless
58 :option:`-frounding-math` is used and :option:`-fno-trapping-math` is not
59 in which case it is 'on'.
60
61* Additional floating-point exceptions, rounding modes, environments,
62 and classifications, and their macro names (C99 and C11 7.6, C99 and
63 C11 7.12).
64
65 This is dependent on the implementation of the C library, and is not
66 defined by GCC itself.
67
68* The default state for the ``FP_CONTRACT`` pragma (C99 and C11
69 7.12.2).
70
71 This pragma is not implemented. Expressions are currently only
72 contracted if :option:`-ffp-contract=fast`,
73 :option:`-funsafe-math-optimizations` or :option:`-ffast-math` are used.
74 This is subject to change.
75
76* Whether the 'inexact' floating-point exception can be raised
77 when the rounded result actually does equal the mathematical result
78 in an IEC 60559 conformant implementation (C99 F.9).
79
80 This is dependent on the implementation of the C library, and is not
81 defined by GCC itself.
82
83* Whether the 'underflow' (and 'inexact') floating-point
84 exception can be raised when a result is tiny but not inexact in an
85 IEC 60559 conformant implementation (C99 F.9).
86
87 This is dependent on the implementation of the C library, and is not
a0ccbac8 88 defined by GCC itself.