FEUPDATEENV(3P)
π FEUPDATEENV(3P) β bestie edition π
okay so this one is from the POSIX Programmer's Manual (yes, that whole family of pages), and it's all about feupdateenv. buckle up π
πΈ PROLOG πΈ
ok so real talk first: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior, bestie), or the interface might not even be implemented on Linux at all. not me being the bearer of bad news π
β¨ NAME β¨
feupdateenv β update floating-point environment
π¦ SYNOPSIS π¦
#include <fenv.h>
int feupdateenv(const fenv_t *envp);
π DESCRIPTION π
so the functionality described on this reference page is aligned with the ISO C standard. and if there's any conflict between what's required here and what the ISO C standard says, that conflict is unintentional β like, nobody meant it. this volume of POSIX.1β2017 defers to the ISO C standard. periodt. π
now the actual tea: the feupdateenv() function shall attempt to save the currently raised floating-point exceptions in its automatic storage, attempt to install the floating-point environment represented by the object pointed to by envp, and then attempt to raise the saved floating-point exceptions.
and the argument envp shall point to an object set by a call to feholdexcept() or fegetenv(), or equal a floating-point environment macro. so basically it's gotta be a legit env, no random pointers, okay? π
π₯ RETURN VALUE π₯
feupdateenv() shall return a zero value if and only if all the required actions were successfully carried out. zero = slay, non-zero = something went sideways.
π«Ά ERRORS π«Ά
No errors are defined. iconic, honestly. zero drama.
also, the following sections are informative. (translation: the next few are vibes/context, not hard requirements π)
π EXAMPLES π
here's a sample showing how you'd hide spurious underflow floating-point exceptions. look at the code, it's giving clean:
#include <fenv.h>
double f(double x)
{
#pragma STDC FENV_ACCESS ON
double result;
fenv_t save_env;
feholdexcept(&save_env);
// compute result
if (/* test spurious underflow */)
feclearexcept(FE_UNDERFLOW);
feupdateenv(&save_env);
return result;
}
π APPLICATION USAGE π
None. nothing to add, bestie. it's giving minimal.
β RATIONALE β
None. again, nothing. truly unbothered.
π§ FUTURE DIRECTIONS π§
None. no plans, no plot twists, no nothing. π€·ββοΈ
π SEE ALSO π
fegetenv()feholdexcept()
and from the Base Definitions volume of POSIX.1β2017: <fenv.h> πΈ
π COPYRIGHT π
ok so legally obligated moment, but it matters so here it is fr fr:
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 is the main character here, no cap.)
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 π stay safe out there, check your floating-point envs, and remember: save your exceptions before you install the new environment, then raise 'em back. that's the whole plot. π¦β¨
IEEE/The Open Group β 2017 β FEUPDATEENV(3P) πΈ bye bestie, mwah π
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms