FEGETEXCEPTFLAG(3POSIX)
π FEGETEXCEPTFLAG(3POSIX) π
okay bestie, welcome to the POSIX Programmer's Manual π this page is literally part of it. Quick lil heads up tho: the Linux implementation of this interface may be different, so go peek at the matching Linux manual page for the deets on how Linux actually behaves β or the interface might not even be implemented on Linux at all. π iykyk.
β¨ NAME β¨
fegetexceptflag, fesetexceptflag β grab and set those floating-point status flags, no cap π
πΈ SYNOPSIS πΈ
#include <fenv.h>
int fegetexceptflag(fexcept_t *flagp, int excepts);
int fesetexceptflag(const fexcept_t *flagp, int excepts);
π¦ DESCRIPTION π¦
so the tea is: everything on this reference page is aligned with the ISO C standard. if anything here ever beefs with the ISO C standard, that's unintentional bestie, promise. this volume of POSIX.1β2017 just defers to the ISO C standard, periodt. π
okay so fegetexceptflag() β what it does is it attempts to store an implementation-defined representation of the states of the floating-point status flags that are indicated by the excepts argument, and it drops that representation into the object pointed to by the flagp argument. π
and fesetexceptflag() β it attempts to set the floating-point status flags indicated by the excepts argument to the states that are stored in the object pointed to by flagp. β here's the important bit tho: the value that flagp points to shall have been set by a previous call to fegetexceptflag() whose second argument represented at least those floating-point exceptions represented by the excepts argument. don't freestyle it bestie. π
βοΈ
also fesetexceptflag() does not raise floating-point exceptions β it only sets the state of the flags. it's giving "quietly updating the vibe", not "starting drama". π
π RETURN VALUE π
if the representation was successfully stored, fegetexceptflag() shall return zero. otherwise it shall return a non-zero value. π
for fesetexceptflag(): if the excepts argument is zero, or if all the specified exceptions were successfully set, it shall return zero. otherwise it shall return a non-zero value. that's the whole contract, slay.
π ERRORS π
no errors are defined. iconique. β¨
heads up: the following sections are informative only (aka not the actual requirements, just vibes) π
π EXAMPLES π
None. β yeah bestie, nothing here. π«Ά
π§ APPLICATION USAGE π§
None. β also nothing. we love a low-effort section. π
π RATIONALE π
None. β nope, nada. π
β FUTURE DIRECTIONS β
None. β the future is unspecified and honestly? it's giving mystery. π¦
π SEE ALSO π
feclearexcept()feraiseexcept()fetestexcept()
and the Base Definitions volume of POSIX.1β2017, <fenv.h> πΈ
π COPYRIGHT π
some of this text is reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. π
and listen β if there's ever a discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document, no arguments. the original Standard can be obtained online at http://www.opengroup.org/unix/online.html . π
any typographical or formatting errors that show up in this page are most likely from the conversion of the source files into man page format. to report those, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . π
and that's the whole page bestie!! π«Ά brought to you by IEEE/The Open Group, 2017 β FEGETEXCEPTFLAG(3POSIX), mwah, go get those flags. πβ¨
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms