C 程式設計/fenv.h
外觀
< C 程式設計
fenv.h 是一個頭檔案,包含用於操作浮點環境的各種函式和宏。[1]
此標頭檔案聲明瞭兩種型別,fenv_t(表示整個浮點環境)和 fexcept_t(表示浮點狀態標誌)。[1] 它還聲明瞭幾個特徵宏,以 FE_ 和一個大寫字母開頭。
除了 fegetround 和 fetestexcept 之外,這些函式在成功/失敗時返回零/非零。
| 宣告 | 描述 |
|---|---|
int (int excepts); |
清除由 excepts 指定的異常 |
int (fenv_t *penv); |
將當前浮點環境儲存在 penv 中 |
int (fexcept_t *pflag, int excepts); |
將當前狀態標誌儲存在 pflags 中 |
int (void); |
檢索當前舍入方向 |
int (fenv_t *penv); |
將當前浮點環境儲存到 penv 並清除所有異常 |
int (int excepts); |
引發浮點異常 |
int (const fenv_t *penv); |
將當前浮點環境設定為 penv |
int (const fexcept_t *pflags, int excepts); |
將當前狀態標誌設定為儲存在 pflags 中的那些標誌 |
int (int round); |
將當前舍入方向設定為 round |
int (int excepts); |
測試是否已引發某些異常 |
int (const fenv_t *penv); |
恢復浮點環境 penv,但保留當前異常 |
int fesetprec(int prec) |
將精度模式設定為 prec 指定的值。 |