1FEUPDATEENV(3P)            POSIX Programmer's Manual           FEUPDATEENV(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       feupdateenv — update floating-point environment
13

SYNOPSIS

15       #include <fenv.h>
16
17       int feupdateenv(const fenv_t *envp);
18

DESCRIPTION

20       The functionality described on this reference page is aligned with  the
21       ISO C  standard.  Any  conflict between the requirements described here
22       and the ISO C standard is unintentional. This  volume  of  POSIX.1‐2017
23       defers to the ISO C standard.
24
25       The  feupdateenv()  function shall attempt to save the currently raised
26       floating-point exceptions in its automatic storage, attempt to  install
27       the  floating-point environment represented by the object pointed to by
28       envp, and then attempt to raise the  saved  floating-point  exceptions.
29       The  argument  envp shall point to an object set by a call to feholdex‐
30       cept() or fegetenv(), or equal a floating-point environment macro.
31

RETURN VALUE

33       The feupdateenv() function shall return a zero value if and only if all
34       the required actions were successfully carried out.
35

ERRORS

37       No errors are defined.
38
39       The following sections are informative.
40

EXAMPLES

42       The  following  example  shows  sample  code to hide spurious underflow
43       floating-point exceptions:
44
45
46           #include <fenv.h>
47           double f(double x)
48           {
49               #pragma STDC FENV_ACCESS ON
50               double result;
51               fenv_t save_env;
52               feholdexcept(&save_env);
53               // compute result
54               if (/* test spurious underflow */)
55               feclearexcept(FE_UNDERFLOW);
56               feupdateenv(&save_env);
57               return result;
58           }
59

APPLICATION USAGE

61       None.
62

RATIONALE

64       None.
65

FUTURE DIRECTIONS

67       None.
68

SEE ALSO

70       fegetenv(), feholdexcept()
71
72       The Base Definitions volume of POSIX.1‐2017, <fenv.h>
73
75       Portions of this text are reprinted and reproduced in  electronic  form
76       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
77       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
78       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
79       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
80       event of any discrepancy between this version and the original IEEE and
81       The Open Group Standard, the original IEEE and The Open Group  Standard
82       is  the  referee document. The original Standard can be obtained online
83       at http://www.opengroup.org/unix/online.html .
84
85       Any typographical or formatting errors that appear  in  this  page  are
86       most likely to have been introduced during the conversion of the source
87       files to man page format. To report such errors,  see  https://www.ker
88       nel.org/doc/man-pages/reporting_bugs.html .
89
90
91
92IEEE/The Open Group                  2017                      FEUPDATEENV(3P)
Impressum