標準庫標頭檔案 <cfenv> (C++11)
來自 cppreference.com
此標頭檔案最初在 C 標準庫中為 <fenv.h>。
此標頭檔案是浮點環境庫的一部分。
目錄 |
[編輯] 型別
fenv_t (C++11) |
表示整個浮點環境的型別 (typedef) |
fexcept_t (C++11) |
表示所有浮點狀態標誌的型別 (typedef) |
[編輯] 函式
(C++11) |
清除指定的浮點狀態標誌 (函式) |
(C++11) |
確定哪些指定的浮點狀態標誌已設定 (函式) |
(C++11) |
引發指定的浮點異常 (函式) |
(C++11)(C++11) |
從浮點環境或向浮點環境複製指定浮點狀態標誌的狀態 (函式) |
(C++11)(C++11) |
獲取或設定舍入方向 (函式) |
(C++11) |
儲存或恢復當前浮點環境 (函式) |
(C++11) |
儲存環境,清除所有狀態標誌並忽略所有未來錯誤 (函式) |
(C++11) |
恢復浮點環境並引發先前引發的異常 (函式) |
[編輯] 宏
浮點異常 (宏常量) | |
浮點舍入方向 (宏常量) | |
(C++11) |
預設浮點環境 (宏常量) |
[編輯] 概要
#define FE_ALL_EXCEPT /* see description */ #define FE_DIVBYZERO /* see description */ // optional #define FE_INEXACT /* see description */ // optional #define FE_INVALID /* see description */ // optional #define FE_OVERFLOW /* see description */ // optional #define FE_UNDERFLOW /* see description */ // optional #define FE_DOWNWARD /* see description */ // optional #define FE_TONEAREST /* see description */ // optional #define FE_TOWARDZERO /* see description */ // optional #define FE_UPWARD /* see description */ // optional #define FE_DFL_ENV /* see description */ namespace std { // types using fenv_t = /* object type */; using fexcept_t = /* object type */; // 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); }
[編輯] 缺陷報告
下列更改行為的缺陷報告追溯地應用於以前出版的 C++ 標準。
缺陷報告 | 應用於 | 釋出時的行為 | 正確的行為 |
---|---|---|---|
LWG 3905 | C++11 | std::fexcept_t 必須是整數型別 |
它是一個物件型別 |