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

exp2.3p (4368B)


  1. '\" et
  2. .TH EXP2 "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. exp2,
  12. exp2f,
  13. exp2l
  14. \(em exponential base 2 functions
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <math.h>
  19. .P
  20. double exp2(double \fIx\fP);
  21. float exp2f(float \fIx\fP);
  22. long double exp2l(long double \fIx\fP);
  23. .fi
  24. .SH DESCRIPTION
  25. The functionality described on this reference page is aligned with the
  26. ISO\ C standard. Any conflict between the requirements described here and the
  27. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  28. .P
  29. These functions shall compute the base-2 exponential of
  30. .IR x .
  31. .P
  32. An application wishing to check for error situations should set
  33. .IR errno
  34. to zero and call
  35. .IR feclearexcept (FE_ALL_EXCEPT)
  36. before calling these functions. On return, if
  37. .IR errno
  38. is non-zero or \fIfetestexcept\fR(FE_INVALID | FE_DIVBYZERO |
  39. FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
  40. .SH "RETURN VALUE"
  41. Upon successful completion, these functions shall return
  42. 2\fI\s-3\ux\d\s+3\fR.
  43. .P
  44. If the correct value would cause overflow, a range error shall occur
  45. and
  46. \fIexp2\fR(),
  47. \fIexp2f\fR(),
  48. and
  49. \fIexp2l\fR()
  50. shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL,
  51. respectively.
  52. .P
  53. If the correct value would cause underflow,
  54. and is not representable,
  55. a range error may occur, and
  56. \fIexp2\fR(),
  57. \fIexp2f\fR(),
  58. and
  59. \fIexp2l\fR()
  60. shall return
  61. 0.0, or
  62. (if the IEC 60559 Floating-Point option is not supported) an
  63. implementation-defined value no greater in magnitude than DBL_MIN,
  64. FLT_MIN, and LDBL_MIN, respectively.
  65. .P
  66. If
  67. .IR x
  68. is NaN, a NaN shall be returned.
  69. .P
  70. If
  71. .IR x
  72. is \(+-0, 1 shall be returned.
  73. .P
  74. If
  75. .IR x
  76. is \-Inf, +0 shall be returned.
  77. .P
  78. If
  79. .IR x
  80. is +Inf,
  81. .IR x
  82. shall be returned.
  83. .P
  84. If the correct value would cause underflow, and is representable, a
  85. range error may occur and the correct value shall be returned.
  86. .SH ERRORS
  87. These functions shall fail if:
  88. .IP "Range\ Error" 12
  89. The result overflows.
  90. .RS 12
  91. .P
  92. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  93. non-zero, then
  94. .IR errno
  95. shall be set to
  96. .BR [ERANGE] .
  97. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  98. non-zero, then the overflow floating-point exception shall be raised.
  99. .RE
  100. .P
  101. These functions may fail if:
  102. .IP "Range\ Error" 12
  103. The result underflows.
  104. .RS 12
  105. .P
  106. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  107. non-zero, then
  108. .IR errno
  109. shall be set to
  110. .BR [ERANGE] .
  111. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  112. non-zero, then the underflow floating-point exception shall be raised.
  113. .RE
  114. .LP
  115. .IR "The following sections are informative."
  116. .SH EXAMPLES
  117. None.
  118. .SH "APPLICATION USAGE"
  119. On error, the expressions (\fImath_errhandling\fR & MATH_ERRNO) and
  120. (\fImath_errhandling\fR & MATH_ERREXCEPT) are independent of each
  121. other, but at least one of them must be non-zero.
  122. .SH RATIONALE
  123. None.
  124. .SH "FUTURE DIRECTIONS"
  125. None.
  126. .SH "SEE ALSO"
  127. .IR "\fIexp\fR\^(\|)",
  128. .IR "\fIfeclearexcept\fR\^(\|)",
  129. .IR "\fIfetestexcept\fR\^(\|)",
  130. .IR "\fIisnan\fR\^(\|)",
  131. .IR "\fIlog\fR\^(\|)"
  132. .P
  133. The Base Definitions volume of POSIX.1\(hy2017,
  134. .IR "Section 4.20" ", " "Treatment of Error Conditions for Mathematical Functions",
  135. .IR "\fB<math.h>\fP"
  136. .\"
  137. .SH COPYRIGHT
  138. Portions of this text are reprinted and reproduced in electronic form
  139. from IEEE Std 1003.1-2017, Standard for Information Technology
  140. -- Portable Operating System Interface (POSIX), The Open Group Base
  141. Specifications Issue 7, 2018 Edition,
  142. Copyright (C) 2018 by the Institute of
  143. Electrical and Electronics Engineers, Inc and The Open Group.
  144. In the event of any discrepancy between this version and the original IEEE and
  145. The Open Group Standard, the original IEEE and The Open Group Standard
  146. is the referee document. The original Standard can be obtained online at
  147. http://www.opengroup.org/unix/online.html .
  148. .PP
  149. Any typographical or formatting errors that appear
  150. in this page are most likely
  151. to have been introduced during the conversion of the source files to
  152. man page format. To report such errors, see
  153. https://www.kernel.org/doc/man-pages/reporting_bugs.html .