std::fegete...etexceptflag(3)
β¨ std::fegetexceptflag, std::fesetexceptflag β¨
Okay so bestie, welcome to the std::fegetexceptflag / std::fesetexceptflag glow-up π
. This page lives in the C++ Standard Library manual, and it's all about grabbing and setting those floating-point exception flags. No cap, it's giving "save file for your math errors" energy. π
πΈ SYNOPSIS πΈ
Defined in header <cfenv>.
int fegetexceptflag( std::fexcept_t* flagp, int excepts ); (1)
(since C++11)
int fesetexceptflag( const std::fexcept_t* flagp, int excepts ); (2)
(since C++11)
So here's the tea, one by one:
- Attempts to obtain the full contents of the floating-point exception flags that are listed in the bitmask argument
excepts, which is a bitwise OR of the floating point exception macros. π«Ά - Attempts to copy the full contents of the floating-point exception flags that are listed in
exceptsfromflagpinto the floating-point environment. It does not raise any exceptions, bestie β it only modifies the flags. Periodt. β¨
Now, this is the part where I need you to lock in, because it's lowkey important: the full contents of a floating-point exception flag is not necessarily a boolean value indicating whether the exception is raised or cleared. For example, it may be a struct which includes the boolean status and the address of the code that triggered the exception. These functions obtain all such content and obtain/store it in flagp in implementation-defined format. So yeah, it's giving "more than just a yes/no" and you just gotta trust the implementation. π
π PARAMETERS π
flagpβ pointer to anstd::fexcept_tobject where the flags will be stored or read from. π¦exceptsβ bitmask listing the exception flags to get/set. π
β RETURN VALUE β
0 on success, non-zero otherwise. That's it, that's the whole vibe check. π
π₯ SEE ALSO π₯
C documentation for fegetexceptflag, fesetexceptflag β go check the C side if you want the og lore, iykyk. π
Okay bestie, that's the whole page! You ate that. π β¨ And just so we're keeping it 100, this masterpiece came from cppreference.com, dated 2024.06.10. Iconic behavior, fr fr. ππ«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms