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

fegetround.3p (3086B)


  1. '\" et
  2. .TH FEGETROUND "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. fegetround,
  12. fesetround
  13. \(em get and set current rounding direction
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <fenv.h>
  18. .P
  19. int fegetround(void);
  20. int fesetround(int \fIround\fP);
  21. .fi
  22. .SH DESCRIPTION
  23. The functionality described on this reference page is aligned with the
  24. ISO\ C standard. Any conflict between the requirements described here and the
  25. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  26. .P
  27. The
  28. \fIfegetround\fR()
  29. function shall get the current rounding direction.
  30. .P
  31. The
  32. \fIfesetround\fR()
  33. function shall establish the rounding direction represented by its
  34. argument
  35. .IR round .
  36. If the argument is not equal to the value of a rounding direction
  37. macro, the rounding direction is not changed.
  38. .SH "RETURN VALUE"
  39. The
  40. \fIfegetround\fR()
  41. function shall return the value of the rounding direction macro
  42. representing the current rounding direction or a negative value if
  43. there is no such rounding direction macro or the current rounding
  44. direction is not determinable.
  45. .P
  46. The
  47. \fIfesetround\fR()
  48. function shall return a zero value if and only if the requested
  49. rounding direction was established.
  50. .SH ERRORS
  51. No errors are defined.
  52. .LP
  53. .IR "The following sections are informative."
  54. .SH EXAMPLES
  55. The following example saves, sets, and restores the rounding direction,
  56. reporting an error and aborting if setting the rounding direction
  57. fails:
  58. .sp
  59. .RS 4
  60. .nf
  61. #include <fenv.h>
  62. #include <assert.h>
  63. void f(int round_dir)
  64. {
  65. #pragma STDC FENV_ACCESS ON
  66. int save_round;
  67. int setround_ok;
  68. save_round = fegetround();
  69. setround_ok = fesetround(round_dir);
  70. assert(setround_ok == 0);
  71. /* ... */
  72. fesetround(save_round);
  73. /* ... */
  74. }
  75. .fi
  76. .P
  77. .RE
  78. .SH "APPLICATION USAGE"
  79. None.
  80. .SH RATIONALE
  81. None.
  82. .SH "FUTURE DIRECTIONS"
  83. None.
  84. .SH "SEE ALSO"
  85. The Base Definitions volume of POSIX.1\(hy2017,
  86. .IR "\fB<fenv.h>\fP"
  87. .\"
  88. .SH COPYRIGHT
  89. Portions of this text are reprinted and reproduced in electronic form
  90. from IEEE Std 1003.1-2017, Standard for Information Technology
  91. -- Portable Operating System Interface (POSIX), The Open Group Base
  92. Specifications Issue 7, 2018 Edition,
  93. Copyright (C) 2018 by the Institute of
  94. Electrical and Electronics Engineers, Inc and The Open Group.
  95. In the event of any discrepancy between this version and the original IEEE and
  96. The Open Group Standard, the original IEEE and The Open Group Standard
  97. is the referee document. The original Standard can be obtained online at
  98. http://www.opengroup.org/unix/online.html .
  99. .PP
  100. Any typographical or formatting errors that appear
  101. in this page are most likely
  102. to have been introduced during the conversion of the source files to
  103. man page format. To report such errors, see
  104. https://www.kernel.org/doc/man-pages/reporting_bugs.html .