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

log1p.3p (4615B)


  1. '\" et
  2. .TH LOG1P "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. log1p,
  12. log1pf,
  13. log1pl
  14. \(em compute a natural logarithm
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <math.h>
  19. .P
  20. double log1p(double \fIx\fP);
  21. float log1pf(float \fIx\fP);
  22. long double log1pl(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 log\d\s-3e\s+3\u(1.0 + \fIx\fP).
  30. .P
  31. An application wishing to check for error situations should set
  32. .IR errno
  33. to zero and call
  34. .IR feclearexcept (FE_ALL_EXCEPT)
  35. before calling these functions. On return, if
  36. .IR errno
  37. is non-zero or \fIfetestexcept\fR(FE_INVALID | FE_DIVBYZERO |
  38. FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
  39. .SH "RETURN VALUE"
  40. Upon successful completion, these functions shall return the natural
  41. logarithm of 1.0 +
  42. .IR x .
  43. .P
  44. If
  45. .IR x
  46. is \-1, a pole error shall occur and
  47. \fIlog1p\fR(),
  48. \fIlog1pf\fR(),
  49. and
  50. \fIlog1pl\fR()
  51. shall return \-HUGE_VAL, \-HUGE_VALF, and \-HUGE_VALL,
  52. respectively.
  53. .P
  54. For finite values of
  55. .IR x
  56. that are less than \-1,
  57. or if
  58. .IR x
  59. is \-Inf,
  60. a domain error shall occur, and
  61. either a NaN (if supported), or
  62. an implementation-defined value shall be returned.
  63. .P
  64. If
  65. .IR x
  66. is NaN, a NaN shall be returned.
  67. .P
  68. If
  69. .IR x
  70. is \(+-0, or +Inf,
  71. .IR x
  72. shall be returned.
  73. .P
  74. If
  75. .IR x
  76. is subnormal, a range error may occur
  77. .br
  78. and
  79. .IR x
  80. should be returned.
  81. .P
  82. If
  83. .IR x
  84. is not returned,
  85. \fIlog1p\fR(),
  86. \fIlog1pf\fR(),
  87. and
  88. \fIlog1pl\fR()
  89. shall return an implementation-defined value no greater in magnitude
  90. than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively.
  91. .SH ERRORS
  92. These functions shall fail if:
  93. .IP "Domain\ Error" 12
  94. The finite value of
  95. .IR x
  96. is less than \-1,
  97. or
  98. .IR x
  99. is \-Inf.
  100. .RS 12
  101. .P
  102. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  103. non-zero, then
  104. .IR errno
  105. shall be set to
  106. .BR [EDOM] .
  107. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  108. non-zero, then the invalid floating-point exception shall be raised.
  109. .RE
  110. .IP "Pole\ Error" 12
  111. The value of
  112. .IR x
  113. is \-1.
  114. .RS 12
  115. .P
  116. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  117. non-zero, then
  118. .IR errno
  119. shall be set to
  120. .BR [ERANGE] .
  121. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  122. non-zero, then the divide-by-zero floating-point exception shall be
  123. raised.
  124. .RE
  125. .br
  126. .P
  127. These functions may fail if:
  128. .IP "Range\ Error" 12
  129. The value of
  130. .IR x
  131. is subnormal.
  132. .RS 12
  133. .P
  134. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  135. non-zero, then
  136. .IR errno
  137. shall be set to
  138. .BR [ERANGE] .
  139. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  140. non-zero, then the underflow floating-point exception shall be raised.
  141. .RE
  142. .LP
  143. .IR "The following sections are informative."
  144. .SH EXAMPLES
  145. None.
  146. .SH "APPLICATION USAGE"
  147. On error, the expressions (\fImath_errhandling\fR & MATH_ERRNO) and
  148. (\fImath_errhandling\fR & MATH_ERREXCEPT) are independent of each
  149. other, but at least one of them must be non-zero.
  150. .SH RATIONALE
  151. None.
  152. .SH "FUTURE DIRECTIONS"
  153. None.
  154. .SH "SEE ALSO"
  155. .IR "\fIfeclearexcept\fR\^(\|)",
  156. .IR "\fIfetestexcept\fR\^(\|)",
  157. .IR "\fIlog\fR\^(\|)"
  158. .P
  159. The Base Definitions volume of POSIX.1\(hy2017,
  160. .IR "Section 4.20" ", " "Treatment of Error Conditions for Mathematical Functions",
  161. .IR "\fB<math.h>\fP"
  162. .\"
  163. .SH COPYRIGHT
  164. Portions of this text are reprinted and reproduced in electronic form
  165. from IEEE Std 1003.1-2017, Standard for Information Technology
  166. -- Portable Operating System Interface (POSIX), The Open Group Base
  167. Specifications Issue 7, 2018 Edition,
  168. Copyright (C) 2018 by the Institute of
  169. Electrical and Electronics Engineers, Inc and The Open Group.
  170. In the event of any discrepancy between this version and the original IEEE and
  171. The Open Group Standard, the original IEEE and The Open Group Standard
  172. is the referee document. The original Standard can be obtained online at
  173. http://www.opengroup.org/unix/online.html .
  174. .PP
  175. Any typographical or formatting errors that appear
  176. in this page are most likely
  177. to have been introduced during the conversion of the source files to
  178. man page format. To report such errors, see
  179. https://www.kernel.org/doc/man-pages/reporting_bugs.html .