FEGETEXCEPTFLAG(3P)

✨ PROLOG ✨

okay so before we even get into it β€” this manual page is part of the POSIX Programmer's Manual. bestie, hear me out: the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or the interface might just straight up not be implemented on Linux at all. πŸ’€


🌸 NAME 🌸

fegetexceptflag, fesetexceptflag β€” get and set 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 functionality described on this reference page is aligned with the ISO C standard. if there's any conflict between what's written here and the ISO C standard, that's unintentional, okay? this volume of POSIX.1‐2017 defers to the ISO C standard. periodt.

the fegetexceptflag() function shall attempt to store an implementation-defined representation of the states of the floating-point status flags indicated by the argument excepts in the object pointed to by the argument flagp. literally just grabbing those flag states and tucking them away. ✨

the fesetexceptflag() function shall attempt to set the floating-point status flags indicated by the argument excepts to the states stored in the object pointed to by flagp. now the important bit, bestie: the value pointed to by flagp shall have been set by a previous call to fegetexceptflag() whose second argument represented at least those floating-point exceptions represented by the argument excepts. so like, you gotta have gotten them first, iykyk. πŸ‘‘

and listen β€” this function does not raise floating-point exceptions. it only sets the state of the flags. that's it. that's the whole vibe. πŸ™ˆ


πŸ’– RETURN VALUE πŸ’–

if the representation was successfully stored, fegetexceptflag() shall return zero. otherwise, it shall return a non-zero value.

if the excepts argument is zero, or if all the specified exceptions were successfully set, fesetexceptflag() shall return zero. otherwise, it shall return a non-zero value. slay. 🫢


πŸ’€ ERRORS πŸ’€

no errors are defined. iconic behavior honestly.

heads up: the following sections are informative. ⭐

🌈 EXAMPLES 🌈

none. πŸ“


🧚 APPLICATION USAGE 🧚

none. πŸŽ€


πŸ‘‘ RATIONALE πŸ‘‘

none. πŸ’œ


⭐ FUTURE DIRECTIONS ⭐

none. ✨


πŸ”₯ SEE ALSO πŸ”₯

  • feclearexcept()
  • feraiseexcept()
  • fetestexcept()
  • the Base Definitions volume of POSIX.1‐2017, <fenv.h>

portions of this text are 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. in the event of any 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. the original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie 🫢 this little cutie came to you courtesy of IEEE/The Open Group, 2017, and yeah β€” FEGETEXCEPTFLAG(3P) is the name of the game, the header AND the footer energy, periodt. πŸ’–πŸŒΈβœ¨

πŸ“¦ where this page comes from