From Jason Turner

[cfenv.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpybn6_5to/{from.md → to.md} +36 -27
tmp/tmpybn6_5to/{from.md → to.md} RENAMED
@@ -1,58 +1,67 @@
1
  ### Header `<cfenv>` synopsis <a id="cfenv.syn">[[cfenv.syn]]</a>
2
 
3
  ``` cpp
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  namespace std {
5
  // types
6
- typedef object type fenv_t;
7
- typedef integer type fexcept_t;
8
 
9
  // functions
10
  int feclearexcept(int except);
11
  int fegetexceptflag(fexcept_t* pflag, int except);
12
  int feraiseexcept(int except);
13
  int fesetexceptflag(const fexcept_t* pflag, int except);
14
  int fetestexcept(int except);
15
 
16
- int fegetround(void);
17
  int fesetround(int mode);
18
 
19
  int fegetenv(fenv_t* penv);
20
  int feholdexcept(fenv_t* penv);
21
  int fesetenv(const fenv_t* penv);
22
  int feupdateenv(const fenv_t* penv);
23
  }
24
  ```
25
 
26
- The header also defines the macros:
27
-
28
- ``` cpp
29
- FE_ALL_EXCEPT
30
- FE_DIVBYZERO
31
- FE_INEXACT
32
- FE_INVALID
33
- FE_OVERFLOW
34
- FE_UNDERFLOW
35
-
36
- FE_DOWNWARD
37
- FE_TONEAREST
38
- FE_TOWARDZERO
39
- FE_UPWARD
40
-
41
- FE_DFL_ENV
42
- ```
43
-
44
- The header defines all functions, types, and macros the same as Clause
45
- 7.6 of the C standard.
46
 
47
  The floating-point environment has thread storage duration (
48
  [[basic.stc.thread]]). The initial state for a thread’s floating-point
49
  environment is the state of the floating-point environment of the thread
50
- that constructs the corresponding `std::thread` object (
51
- [[thread.thread.class]]) at the time it constructed the object. That is,
52
- the child thread gets the floating-point state of the parent thread at
53
- the time of the child’s creation.
 
54
 
55
  A separate floating-point environment shall be maintained for each
56
  thread. Each function accesses the environment corresponding to its
57
  calling thread.
58
 
 
 
 
1
  ### Header `<cfenv>` synopsis <a id="cfenv.syn">[[cfenv.syn]]</a>
2
 
3
  ``` cpp
4
+ #define FE_ALL_EXCEPT see below
5
+ #define FE_DIVBYZERO see below
6
+ #define FE_INEXACT see below
7
+ #define FE_INVALID see below
8
+ #define FE_OVERFLOW see below
9
+ #define FE_UNDERFLOW see below
10
+
11
+ #define FE_DOWNWARD see below
12
+ #define FE_TONEAREST see below
13
+ #define FE_TOWARDZERO see below
14
+ #define FE_UPWARD see below
15
+
16
+ #define FE_DFL_ENV see below
17
+
18
  namespace std {
19
  // types
20
+ using fenv_t = object type;
21
+ using fexcept_t = integer type;
22
 
23
  // functions
24
  int feclearexcept(int except);
25
  int fegetexceptflag(fexcept_t* pflag, int except);
26
  int feraiseexcept(int except);
27
  int fesetexceptflag(const fexcept_t* pflag, int except);
28
  int fetestexcept(int except);
29
 
30
+ int fegetround();
31
  int fesetround(int mode);
32
 
33
  int fegetenv(fenv_t* penv);
34
  int feholdexcept(fenv_t* penv);
35
  int fesetenv(const fenv_t* penv);
36
  int feupdateenv(const fenv_t* penv);
37
  }
38
  ```
39
 
40
+ The contents and meaning of the header `<cfenv>` are the same as the C
41
+ standard library header `<fenv.h>`.
42
+
43
+ [*Note 1*: This International Standard does not require an
44
+ implementation to support the `FENV_ACCESS` pragma; it is
45
+ *implementation-defined* ([[cpp.pragma]]) whether the pragma is
46
+ supported. As a consequence, it is *implementation-defined* whether
47
+ these functions can be used to test floating-point status flags, set
48
+ floating-point control modes, or run under non-default mode settings. If
49
+ the pragma is used to enable control over the floating-point
50
+ environment, this International Standard does not specify the effect on
51
+ floating-point evaluation in constant expressions. — *end note*]
 
 
 
 
 
 
 
 
52
 
53
  The floating-point environment has thread storage duration (
54
  [[basic.stc.thread]]). The initial state for a thread’s floating-point
55
  environment is the state of the floating-point environment of the thread
56
+ that constructs the corresponding `thread` object (
57
+ [[thread.thread.class]]) at the time it constructed the object.
58
+
59
+ [*Note 2*: That is, the child thread gets the floating-point state of
60
+ the parent thread at the time of the child’s creation. — *end note*]
61
 
62
  A separate floating-point environment shall be maintained for each
63
  thread. Each function accesses the environment corresponding to its
64
  calling thread.
65
 
66
+ ISO C 7.6
67
+