Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/header/cfenv"

From cppreference.com
< cpp‎ | header
m (Update links.)
(Added LWG issue #3905 DR.)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{cpp/header/title|cfenv}}
+
{{cpp/header/title|cfenv|notes={{mark c++11}}}}
 
{{cpp/header/navbar}}
 
{{cpp/header/navbar}}
 
{{cpp/header/c}}
 
{{cpp/header/c}}
  
 
This header is part of the [[cpp/numeric/fenv|floating-point environment]] library.
 
This header is part of the [[cpp/numeric/fenv|floating-point environment]] library.
 
  
 
===Types===
 
===Types===
 
{{dsc begin}}
 
{{dsc begin}}
{{dsc | {{c|fenv_t}} | The type representing the entire floating-point environment }}
+
{{dsc|{{ttb|fenv_t}}|The type representing the entire floating-point environment}}
{{dsc | {{c|fexcept_t}} | The type representing all floating-point status flags collectively }}
+
{{dsc|{{ttb|fexcept_t}}|The type representing all floating-point status flags collectively}}
 
{{dsc end}}
 
{{dsc end}}
  
 
===Functions===
 
===Functions===
 
{{dsc begin}}
 
{{dsc begin}}
{{dsc inc | cpp/numeric/fenv/dsc feclearexcept}}
+
{{dsc inc|cpp/numeric/fenv/dsc feclearexcept}}
{{dsc inc | cpp/numeric/fenv/dsc fetestexcept}}
+
{{dsc inc|cpp/numeric/fenv/dsc fetestexcept}}
{{dsc inc | cpp/numeric/fenv/dsc feraiseexcept}}
+
{{dsc inc|cpp/numeric/fenv/dsc feraiseexcept}}
{{dsc inc | cpp/numeric/fenv/dsc feexceptflag}}
+
{{dsc inc|cpp/numeric/fenv/dsc feexceptflag}}
{{dsc inc | cpp/numeric/fenv/dsc feround}}
+
{{dsc inc|cpp/numeric/fenv/dsc feround}}
{{dsc inc | cpp/numeric/fenv/dsc feenv}}
+
{{dsc inc|cpp/numeric/fenv/dsc feenv}}
{{dsc inc | cpp/numeric/fenv/dsc feholdexcept}}
+
{{dsc inc|cpp/numeric/fenv/dsc feholdexcept}}
{{dsc inc | cpp/numeric/fenv/dsc feupdateenv}}
+
{{dsc inc|cpp/numeric/fenv/dsc feupdateenv}}
 
{{dsc end}}
 
{{dsc end}}
  
 
===Macros===
 
===Macros===
 
{{dsc begin}}
 
{{dsc begin}}
{{dsc inc | cpp/numeric/fenv/dsc FE_exceptions}}
+
{{dsc inc|cpp/numeric/fenv/dsc FE_exceptions}}
{{dsc inc | cpp/numeric/fenv/dsc FE_round}}
+
{{dsc inc|cpp/numeric/fenv/dsc FE_round}}
{{dsc inc | cpp/numeric/fenv/dsc FE_DFL_ENV}}
+
{{dsc inc|cpp/numeric/fenv/dsc FE_DFL_ENV}}
 
{{dsc end}}
 
{{dsc end}}
  
 
===Synopsis===
 
===Synopsis===
 
{{source|
 
{{source|
 
 
namespace std {
 
namespace std {
 
     // types
 
     // types
     typedef /*object type*/ fenv_t;
+
     typedef /* object type */ fenv_t;
     typedef /*integer type*/ fexcept_t;
+
     typedef /* object type */ fexcept_t;
 
      
 
      
 
     // functions
 
     // functions
Line 52: Line 50:
 
     int feupdateenv(const fenv_t *penv);
 
     int feupdateenv(const fenv_t *penv);
 
}
 
}
 +
}}
  
 +
===Defect reports===
 +
{{dr list begin}}
 +
{{dr list item|wg=lwg|dr=3905|std=C++11|before={{tt|std::fexcept_t}} must be an integer type|after=it is an object type}}
 +
{{dr list end}}
  
}}
+
{{langlinks|ja|zh}}

Latest revision as of 18:10, 5 November 2023

 
 
Standard library headers
Algorithms
<algorithm>
<numeric>
Strings
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
Text processing
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
Numerics
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<valarray>
Time
<chrono> (C++11)
<ctime>
C compatibility
<ccomplex> (C++11/17/20*)
<ciso646> (until C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

This header was originally in the C standard library as <fenv.h>.

This header is part of the floating-point environment library.

Contents

[edit] Types

fenv_t The type representing the entire floating-point environment
fexcept_t The type representing all floating-point status flags collectively

[edit] Functions

clears the specified floating-point status flags
(function) [edit]
determines which of the specified floating-point status flags are set
(function) [edit]
raises the specified floating-point exceptions
(function) [edit]
copies the state of the specified floating-point status flags from or to the floating-point environment
(function) [edit]
(C++11)(C++11)
gets or sets rounding direction
(function) [edit]
saves or restores the current floating-point environment
(function) [edit]
saves the environment, clears all status flags and ignores all future errors
(function) [edit]
restores the floating-point environment and raises the previously raised exceptions
(function) [edit]

[edit] Macros

floating-point exceptions
(macro constant) [edit]
floating-point rounding direction
(macro constant) [edit]
default floating-point environment
(macro constant) [edit]

[edit] Synopsis

namespace std {
    // types
    typedef /* object type */ fenv_t;
    typedef /* object type */ fexcept_t;
 
    // functions
    int feclearexcept(int except);
    int fegetexceptflag(fexcept_t *pflag, int except);
    int feraiseexcept(int except);
    int fesetexceptflag(const fexcept_t *pflag, int except);
    int fetestexcept(int except);
    int fegetround(void);
    int fesetround(int mode);
    int fegetenv(fenv_t *penv);
    int feholdexcept(fenv_t *penv);
    int fesetenv(const fenv_t *penv);
    int feupdateenv(const fenv_t *penv);
}

[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
LWG 3905 C++11 std::fexcept_t must be an integer type it is an object type