std:: fegetexceptflag, std:: fesetexceptflag
From cppreference.net
C++
Numerics library
| Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data-parallel types (SIMD) (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit manipulation (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Floating-point environment
| Functions | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
fegetexceptflag
fesetexceptflag
(C++11)
(C++11)
|
||||
|
(C++11)
(C++11)
|
||||
|
(C++11)
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Macro constants | ||||
|
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
|
||||
|
(C++11)
(C++11)
(C++11)
(C++11)
|
||||
|
(C++11)
|
|
定义于头文件
<cfenv>
|
||
|
int
fegetexceptflag
(
std::
fexcept_t
*
flagp,
int
excepts
)
;
|
(1) | (C++11 起) |
|
int
fesetexceptflag
(
const
std::
fexcept_t
*
flagp,
int
excepts
)
;
|
(2) | (C++11 起) |
1) 尝试获取浮点异常标志的完整内容,这些标志列于位掩码参数
excepts
中,该参数是
浮点异常宏
的按位或组合。
2) 尝试将
excepts
中列出的浮点异常标志的完整内容从
flagp
复制到浮点环境中。不会引发任何异常,仅修改标志位。
浮点异常标志的完整内容不一定只是表示异常是否被触发或清除的布尔值。例如,它可能是一个结构体,包含布尔状态以及触发异常的代码地址。这些函数以实现定义的格式获取所有此类内容,并将其获取/存储到
flagp
中。
参数
| flagp | - | 指向 std:: fexcept_t 对象的指针,用于存储或读取浮点异常标志 |
| excepts | - | 列出要获取/设置的异常标志的位掩码 |
返回值
0 表示成功,非零值表示失败。
参见
|
C 文档
关于
fegetexceptflag
,
fesetexceptflag
|