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

NAME

6       feupdateenv - update floating-point environment
7

SYNOPSIS

9       #include <fenv.h>
10
11       int feupdateenv(const fenv_t *envp);
12
13

DESCRIPTION

15       The  feupdateenv()  function shall attempt to save the currently raised
16       floating-point exceptions in its automatic storage, attempt to  install
17       the  floating-point environment represented by the object pointed to by
18       envp, and then attempt to raise the  saved  floating-point  exceptions.
19       The  argument  envp shall point to an object set by a call to feholdex‐
20       cept() or fegetenv(), or equal a floating-point environment macro.
21

RETURN VALUE

23       The feupdateenv() function shall return a zero value if and only if all
24       the required actions were successfully carried out.
25

ERRORS

27       No errors are defined.
28
29       The following sections are informative.
30

EXAMPLES

32       The  following  example  shows  sample  code to hide spurious underflow
33       floating-point exceptions:
34
35
36              #include <fenv.h>
37              double f(double x)
38              {
39                  #pragma STDC FENV_ACCESS ON
40                  double result;
41                  fenv_t save_env;
42                  feholdexcept(&save_env);
43                  // compute result
44                  if (/* test spurious underflow */)
45                  feclearexcept(FE_UNDERFLOW);
46                  feupdateenv(&save_env);
47                  return result;
48              }
49

APPLICATION USAGE

51       None.
52

RATIONALE

54       None.
55

FUTURE DIRECTIONS

57       None.
58

SEE ALSO

60       fegetenv()  ,  feholdexcept()  ,  the  Base   Definitions   volume   of
61       IEEE Std 1003.1-2001, <fenv.h>
62
64       Portions  of  this text are reprinted and reproduced in electronic form
65       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
66       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
67       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
68       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
69       event of any discrepancy between this version and the original IEEE and
70       The  Open Group Standard, the original IEEE and The Open Group Standard
71       is the referee document. The original Standard can be  obtained  online
72       at http://www.opengroup.org/unix/online.html .
73
74
75
76IEEE/The Open Group                  2003                       FEUPDATEENV(P)
Impressum