C++官方参考链接:https://cplusplus.com/reference/cfenv/
头文件
<cfenv> (fenv.h)
浮点环境
此头文件声明了一组用于访问浮点环境的函数和宏,以及特定的类型。
浮点环境维护一系列状态标志和特定的控制模式。具体关于浮点环境的内容取决于实现,但状态标志通常包括浮点异常及其相关信息,控制模式至少包括舍入方向。
函数
浮点异常
Clear floating-point exceptions (function)(清除浮点异常(函数))
Raise floating-point exception (function)(引发浮点异常(函数))
Get floating-point exception flags (function)(获取浮点异常标志(函数))
Set floating-point exception flags (function)(设置浮点异常标志(函数))
舍入方向
Get rounding direction mode (function)(获取舍入方向模式(函数))
Set rounding direction mode (function)(设置舍入方向模式(函数))
整个环境
Get floating-point environment (function)(获取浮点环境(函数))
Set floating-point environment (function)(设置浮点环境(函数))
Hold floating-point exceptions (function)(保存浮点异常(函数))
Update floating-point environment (function)(更新浮点环境(函数))
其他
Test for floating-point exceptions (function)(测试浮点异常(函数))
类型
Floating-point environment type (type)(浮点环境类型(类型))
Floating-point exceptions type (type)(浮点异常类型(类型))
宏常量
浮点异常
Pole error exception (macro)(极点错误异常(宏))
Inexact result exception (macro)(不精确结果异常(宏))
Invalid argument exception (macro)(无效实参异常(宏))
Overflow range error exception (macro)(上溢范围错误异常(宏))
Underflow range error exception (macro)(下溢范围错误异常(宏))
All exceptions (macro)(所有异常(宏))
舍入方向
Downward rounding direction mode (macro)(向下舍入方向模式(宏))
To-nearest rounding direction mode (macro)(向最近舍入方向模式(宏))
Toward-zero rounding direction mode (macro)(向零舍入方向模式(宏))
Upward rounding direction mode (macro)(向上舍入方向模式(宏))
整个环境
Default environment (macro)(默认环境(宏))
Pragmas
Access to Floating-point environment (pragma)(访问浮点环境(pragma))