標準ライブラリヘッダー <fenv.h> (C99)
From cppreference.com
このヘッダーは 浮動小数点環境 ライブラリの一部です。
目次 |
[編集] 型
| ヘッダー
<fenv.h> で定義されています。 | |
| fenv_t | 浮動小数点環境全体を表す型 |
| fexcept_t | すべての浮動小数点ステータスフラグをまとめて表す型 |
[編集] 関数
| (C99) |
指定された浮動小数点ステータスフラグをクリアする (関数) |
| (C99) |
指定された浮動小数点ステータスフラグのうちどれが設定されているかを判定する (関数) |
| (C99) |
指定された浮動小数点例外を発生させる (関数) |
| (C99)(C99) |
指定された浮動小数点ステータスフラグの状態を浮動小数点環境との間でコピーする (関数) |
| (C99)(C99) |
丸め方向を取得または設定する (関数) |
| (C99) |
現在の浮動小数点環境を保存または復元する (関数) |
| (C99) |
環境を保存し、すべてのステータスフラグをクリアし、以降のすべてのエラーを無視する (関数) |
| (C99) |
浮動小数点環境を復元し、以前に発生した例外を発生させる (関数) |
[編集] マクロ
| 浮動小数点例外 (マクロ定数) | |
| 浮動小数点数の丸め方向 (マクロ定数) | |
| (C99) |
デフォルトの浮動小数点環境 (マクロ定数) |
[編集] 概要
#define __STDC_VERSION_FENV_H__ 202311L #define FE_ALL_EXCEPT /* see description */ #define FE_DIVBYZERO /* see description */ #define FE_INEXACT /* see description */ #define FE_INVALID /* see description */ #define FE_OVERFLOW /* see description */ #define FE_UNDERFLOW /* see description */ #define FE_DOWNWARD /* see description */ #define FE_TONEARESTFROMZERO /* see description */ #define FE_TONEAREST /* see description */ #define FE_TOWARDZERO /* see description */ #define FE_UPWARD /* see description */ #define FE_DFL_ENV /* see description */ #define FE_DFL_MODE /* see description */ #define fenv_t /* see description */ #define fexcept_t /* see description */ #define femode_t /* see description */ #pragma STDC FENV_ACCESS /*on-off-switch*/ #pragma STDC FENV_ROUND direction #pragma STDC FENV_ROUND FE_DYNAMIC // functions int feclearexcept(int excepts); int fegetexceptflag(fexcept_t* flagp, int excepts); int feraiseexcept(int excepts); int fesetexcept(int excepts); int fesetexceptflag(const fexcept_t* flagp, int excepts); int fetestexceptflag(const fexcept_t* flagp, int excepts); int fetestexcept(int excepts); int fegetmode(femode_t* modep); int fegetround(void); int fesetmode(const femode_t* modep); int fesetround(int rnd); int fegetenv(fenv_t* envp); int feholdexcept(fenv_t* envp); int fesetenv(const fenv_t* envp); int feupdateenv(const fenv_t* envp); // Only if the implementation defines __STDC_IEC_60559_DFP__: #define FE_DEC_DOWNWARD /* implementation-defined */ #define FE_DEC_TONEARESTFROMZERO /* implementation-defined */ #define FE_DEC_TONEAREST /* implementation-defined */ #define FE_DEC_TOWARDZERO /* implementation-defined */ #define FE_DEC_UPWARD /* implementation-defined */ #pragma STDC FENV_DEC_ROUND /*dec-direction*/ int fe_dec_getround(void); int fe_dec_setround(int rnd); // Only if the implementation follows the recommended practice from F.2.2: #define FE_SNANS_ALWAYS_SIGNAL /* implementation-defined */