std::fegete...td::fesetenv(3)
Okay bestie, welcome to the C++ Standard Libary page for std::fegetenv and std::fesetenv β the floating-point environment twins that live under the header your terminal probably truncates to std::fegete...td::fesetenv(3). We're managing the status of the floating-point environment today, and yes, it's giving low-level C++ realness. π
β¨
β¨ NAME β¨
std::fegetenv,std::fesetenv - std::fegetenv,std::fesetenv. Yep, the NAME section is literally the duo saying their own names, and honestly? Iconic. One saves the floating-point environment vibe; one sets it. Periodt. π
π¦ Synopsis π¦
Defined in header <cfenv>.
int fegetenv( std::fenv_t* envp ) (1) (since C++11)
int fesetenv( const std::fenv_t* envp ); (2) (since C++11)
Manages the status of the floating-point environment. No cap.
- Attempts to store the status of the floating-point environment in the object pointed to by
envp. - Attempts to establish the floating-point environment from the object pointed to by
envp. The value of that object must be previously obtained by a call tostd::feholdexceptorstd::fegetenvor be a floating-point macro constant. If any of the floating-point status flags are set inenvp, they become set in the environment (and are then testable withstd::fetestexcept), but the corresponding floating-point exceptions are not raised (execution continues uninterrupted).
Bestie, do not just make up anenvpvalue out of nowhere for the second one β it has to come fromstd::feholdexcept,std::fegetenv, or be a floating-point macro constant. That's the rule. π«Ά
π«Ά Parameters π«Ά
envpβ pointer to the object of typestd::fenv_twhich holds the status of the floating-point environment.
π Return value π
0 on success, non-zero otherwise. Slay when it's zero, bestie. β¨
π See also π
feholdexcept(C++11) β saves the environment, clears all status flags and ignores all future errors (function).feupdateenv(C++11) β restores the floating-point environment and raises the previously raised exceptions (function).FE_DFL_ENV(C++11) β default floating-point environment (macro constant).- C documentation for
fegetenv,fesetenv
π Source checkpoint, bestie: http://cppreference.com, version 2024.06.10, and the footer page title std::fegete...td::fesetenv(3) β that's the whole sign-off tea. π«Άπ
π¦ 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