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

scalbln.3p (5289B)


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