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

logb.3p (4331B)


  1. '\" et
  2. .TH LOGB "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. logb,
  12. logbf,
  13. logbl
  14. \(em radix-independent exponent
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <math.h>
  19. .P
  20. double logb(double \fIx\fP);
  21. float logbf(float \fIx\fP);
  22. long double logbl(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 exponent of
  30. .IR x ,
  31. which is the integral part of log\fI\d\s-3r\s+3\u\fR
  32. |\|\fIx\fR\||, as a signed floating-point value, for non-zero
  33. .IR x ,
  34. where
  35. .IR r
  36. is the radix of the machine's floating-point arithmetic, which is the
  37. value of FLT_RADIX defined in the
  38. .IR <float.h>
  39. header.
  40. .P
  41. If
  42. .IR x
  43. is subnormal it is treated as though it were normalized; thus for
  44. finite positive
  45. .IR x :
  46. .sp
  47. .RS 4
  48. .nf
  49. 1 <= \fIx\fP * FLT_RADIX\s-3\u-logb(x)\d\s+3 < FLT_RADIX
  50. .fi
  51. .P
  52. .RE
  53. .P
  54. An application wishing to check for error situations should set
  55. .IR errno
  56. to zero and call
  57. .IR feclearexcept (FE_ALL_EXCEPT)
  58. before calling these functions. On return, if
  59. .IR errno
  60. is non-zero or \fIfetestexcept\fR(FE_INVALID | FE_DIVBYZERO |
  61. FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
  62. .SH "RETURN VALUE"
  63. Upon successful completion, these functions shall return the exponent
  64. of
  65. .IR x .
  66. .P
  67. If
  68. .IR x
  69. is \(+-0,
  70. \fIlogb\fR(),
  71. \fIlogbf\fR(),
  72. and
  73. \fIlogbl\fR()
  74. shall return \-HUGE_VAL, \-HUGE_VALF, and \-HUGE_VALL,
  75. respectively.
  76. .P
  77. On systems that support the IEC 60559 Floating-Point option, a pole
  78. error shall occur;
  79. .br
  80. otherwise, a
  81. pole
  82. error may occur.
  83. .P
  84. If
  85. .IR x
  86. is NaN, a NaN shall be returned.
  87. .P
  88. If
  89. .IR x
  90. is \(+-Inf, +Inf shall be returned.
  91. .SH ERRORS
  92. These functions shall fail if:
  93. .IP "Pole\ Error" 12
  94. The value of
  95. .IR x
  96. is \(+-0.
  97. .RS 12
  98. .P
  99. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  100. non-zero, then
  101. .IR errno
  102. shall be set to
  103. .BR [ERANGE] .
  104. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  105. non-zero, then the divide-by-zero floating-point exception shall be
  106. raised.
  107. .RE
  108. .P
  109. These functions may fail if:
  110. .IP "Pole\ Error" 12
  111. The value of
  112. .IR x
  113. is 0.
  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. .LP
  126. .IR "The following sections are informative."
  127. .SH EXAMPLES
  128. None.
  129. .SH "APPLICATION USAGE"
  130. On error, the expressions (\fImath_errhandling\fR & MATH_ERRNO) and
  131. (\fImath_errhandling\fR & MATH_ERREXCEPT) are independent of each
  132. other, but at least one of them must be non-zero.
  133. .SH RATIONALE
  134. None.
  135. .SH "FUTURE DIRECTIONS"
  136. None.
  137. .SH "SEE ALSO"
  138. .IR "\fIfeclearexcept\fR\^(\|)",
  139. .IR "\fIfetestexcept\fR\^(\|)",
  140. .IR "\fIilogb\fR\^(\|)",
  141. .IR "\fIscalbln\fR\^(\|)"
  142. .P
  143. The Base Definitions volume of POSIX.1\(hy2017,
  144. .IR "Section 4.20" ", " "Treatment of Error Conditions for Mathematical Functions",
  145. .IR "\fB<float.h>\fP",
  146. .IR "\fB<math.h>\fP"
  147. .\"
  148. .SH COPYRIGHT
  149. Portions of this text are reprinted and reproduced in electronic form
  150. from IEEE Std 1003.1-2017, Standard for Information Technology
  151. -- Portable Operating System Interface (POSIX), The Open Group Base
  152. Specifications Issue 7, 2018 Edition,
  153. Copyright (C) 2018 by the Institute of
  154. Electrical and Electronics Engineers, Inc and The Open Group.
  155. In the event of any discrepancy between this version and the original IEEE and
  156. The Open Group Standard, the original IEEE and The Open Group Standard
  157. is the referee document. The original Standard can be obtained online at
  158. http://www.opengroup.org/unix/online.html .
  159. .PP
  160. Any typographical or formatting errors that appear
  161. in this page are most likely
  162. to have been introduced during the conversion of the source files to
  163. man page format. To report such errors, see
  164. https://www.kernel.org/doc/man-pages/reporting_bugs.html .