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
11

NAME

13       feupdateenv — update floating-point environment
14

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

EXAMPLES

43       The  following  example  shows  sample  code to hide spurious underflow
44       floating-point exceptions:
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‐2008, <fenv.h>
73
75       Portions of this text are reprinted and reproduced in  electronic  form
76       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
77       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
78       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
79       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
80       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
81       event of any discrepancy between this version and the original IEEE and
82       The  Open Group Standard, the original IEEE and The Open Group Standard
83       is the referee document. The original Standard can be  obtained  online
84       at http://www.unix.org/online.html .
85
86       Any  typographical  or  formatting  errors that appear in this page are
87       most likely to have been introduced during the conversion of the source
88       files  to  man page format. To report such errors, see https://www.ker
89       nel.org/doc/man-pages/reporting_bugs.html .
90
91
92
93IEEE/The Open Group                  2013                      FEUPDATEENV(3P)
Impressum