logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

feupdateenv.3p (2954B)


  1. '\" et
  2. .TH FEUPDATEENV "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. feupdateenv
  12. \(em update floating-point environment
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <fenv.h>
  17. .P
  18. int feupdateenv(const fenv_t *\fIenvp\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The functionality described on this reference page is aligned with the
  22. ISO\ C standard. Any conflict between the requirements described here and the
  23. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  24. .P
  25. The
  26. \fIfeupdateenv\fR()
  27. function shall attempt to save the currently raised floating-point
  28. exceptions in its automatic storage, attempt to install the
  29. floating-point environment represented by the object pointed to by
  30. .IR envp ,
  31. and then attempt to raise the saved floating-point exceptions. The
  32. argument
  33. .IR envp
  34. shall point to an object set by a call to
  35. \fIfeholdexcept\fR()
  36. or
  37. \fIfegetenv\fR(),
  38. or equal a floating-point environment macro.
  39. .SH "RETURN VALUE"
  40. The
  41. \fIfeupdateenv\fR()
  42. function shall return a zero value if and only if all the required
  43. actions were successfully carried out.
  44. .SH ERRORS
  45. No errors are defined.
  46. .LP
  47. .IR "The following sections are informative."
  48. .SH EXAMPLES
  49. The following example shows sample code to hide spurious underflow
  50. floating-point exceptions:
  51. .sp
  52. .RS 4
  53. .nf
  54. #include <fenv.h>
  55. double f(double x)
  56. {
  57. #pragma STDC FENV_ACCESS ON
  58. double result;
  59. fenv_t save_env;
  60. feholdexcept(&save_env);
  61. // compute result
  62. if (/* test spurious underflow */)
  63. feclearexcept(FE_UNDERFLOW);
  64. feupdateenv(&save_env);
  65. return result;
  66. }
  67. .fi
  68. .P
  69. .RE
  70. .SH "APPLICATION USAGE"
  71. None.
  72. .SH RATIONALE
  73. None.
  74. .SH "FUTURE DIRECTIONS"
  75. None.
  76. .SH "SEE ALSO"
  77. .IR "\fIfegetenv\fR\^(\|)",
  78. .IR "\fIfeholdexcept\fR\^(\|)"
  79. .P
  80. The Base Definitions volume of POSIX.1\(hy2017,
  81. .IR "\fB<fenv.h>\fP"
  82. .\"
  83. .SH COPYRIGHT
  84. Portions of this text are reprinted and reproduced in electronic form
  85. from IEEE Std 1003.1-2017, Standard for Information Technology
  86. -- Portable Operating System Interface (POSIX), The Open Group Base
  87. Specifications Issue 7, 2018 Edition,
  88. Copyright (C) 2018 by the Institute of
  89. Electrical and Electronics Engineers, Inc and The Open Group.
  90. In the event of any discrepancy between this version and the original IEEE and
  91. The Open Group Standard, the original IEEE and The Open Group Standard
  92. is the referee document. The original Standard can be obtained online at
  93. http://www.opengroup.org/unix/online.html .
  94. .PP
  95. Any typographical or formatting errors that appear
  96. in this page are most likely
  97. to have been introduced during the conversion of the source files to
  98. man page format. To report such errors, see
  99. https://www.kernel.org/doc/man-pages/reporting_bugs.html .