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
19

DESCRIPTION

21       The feupdateenv() function shall attempt to save the  currently  raised
22       floating-point  exceptions in its automatic storage, attempt to install
23       the floating-point environment represented by the object pointed to  by
24       envp,  and  then  attempt to raise the saved floating-point exceptions.
25       The argument envp shall point to an object set by a call  to  feholdex‐
26       cept() or fegetenv(), or equal a floating-point environment macro.
27

RETURN VALUE

29       The feupdateenv() function shall return a zero value if and only if all
30       the required actions were successfully carried out.
31

ERRORS

33       No errors are defined.
34
35       The following sections are informative.
36

EXAMPLES

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

APPLICATION USAGE

57       None.
58

RATIONALE

60       None.
61

FUTURE DIRECTIONS

63       None.
64

SEE ALSO

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