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

llrint.3p (4850B)


  1. '\" et
  2. .TH LLRINT "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. llrint,
  12. llrintf,
  13. llrintl
  14. \(em round to the nearest integer value using current rounding direction
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <math.h>
  19. .P
  20. long long llrint(double \fIx\fP);
  21. long long llrintf(float \fIx\fP);
  22. long long llrintl(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 round their argument to the nearest integer
  30. value, rounding according to the current rounding direction.
  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 the rounded
  42. integer value.
  43. .P
  44. If
  45. .IR x
  46. is NaN, a domain error shall occur, and an unspecified value is
  47. returned.
  48. .P
  49. If
  50. .IR x
  51. is +Inf, a domain error shall occur and an unspecified value is
  52. returned.
  53. .P
  54. If
  55. .IR x
  56. is \-Inf, a domain error shall occur and an unspecified value is
  57. returned.
  58. .P
  59. If the correct value is positive and too large to represent as a
  60. .BR "long long" ,
  61. an unspecified value shall be returned.
  62. On systems that support the IEC 60559 Floating-Point option,
  63. a domain error shall occur;
  64. otherwise, a
  65. domain
  66. error may occur.
  67. .P
  68. If the correct value is negative and too large to represent as a
  69. .BR "long long" ,
  70. an unspecified value shall be returned.
  71. On systems that support the IEC 60559 Floating-Point option,
  72. a domain error shall occur;
  73. otherwise, a
  74. domain
  75. error may occur.
  76. .SH ERRORS
  77. These functions shall fail if:
  78. .IP "Domain\ Error" 12
  79. The
  80. .IR x
  81. argument is NaN or \(+-Inf, or the correct value is not representable
  82. as an integer.
  83. .RS 12
  84. .P
  85. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  86. non-zero, then
  87. .IR errno
  88. shall be set to
  89. .BR [EDOM] .
  90. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  91. non-zero, then the invalid floating-point exception shall be raised.
  92. .RE
  93. .P
  94. These functions may fail if:
  95. .IP "Domain\ Error" 12
  96. The correct value is not representable as an integer.
  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 [EDOM] .
  104. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  105. non-zero, then the invalid floating-point exception shall be raised.
  106. .RE
  107. .LP
  108. .IR "The following sections are informative."
  109. .SH EXAMPLES
  110. None.
  111. .SH "APPLICATION USAGE"
  112. On error, the expressions (\fImath_errhandling\fR & MATH_ERRNO) and
  113. (\fImath_errhandling\fR & MATH_ERREXCEPT) are independent of each
  114. other, but at least one of them must be non-zero.
  115. .SH RATIONALE
  116. These functions provide floating-to-integer conversions. They round
  117. according to the current rounding direction. If the rounded value is
  118. outside the range of the return type, the numeric result is unspecified
  119. and the invalid floating-point exception is raised. When they raise no
  120. other floating-point exception and the result differs from the
  121. argument, they raise the inexact floating-point exception.
  122. .SH "FUTURE DIRECTIONS"
  123. None.
  124. .SH "SEE ALSO"
  125. .IR "\fIfeclearexcept\fR\^(\|)",
  126. .IR "\fIfetestexcept\fR\^(\|)",
  127. .IR "\fIlrint\fR\^(\|)"
  128. .P
  129. The Base Definitions volume of POSIX.1\(hy2017,
  130. .IR "Section 4.20" ", " "Treatment of Error Conditions for Mathematical Functions",
  131. .IR "\fB<math.h>\fP"
  132. .\"
  133. .SH COPYRIGHT
  134. Portions of this text are reprinted and reproduced in electronic form
  135. from IEEE Std 1003.1-2017, Standard for Information Technology
  136. -- Portable Operating System Interface (POSIX), The Open Group Base
  137. Specifications Issue 7, 2018 Edition,
  138. Copyright (C) 2018 by the Institute of
  139. Electrical and Electronics Engineers, Inc and The Open Group.
  140. In the event of any discrepancy between this version and the original IEEE and
  141. The Open Group Standard, the original IEEE and The Open Group Standard
  142. is the referee document. The original Standard can be obtained online at
  143. http://www.opengroup.org/unix/online.html .
  144. .PP
  145. Any typographical or formatting errors that appear
  146. in this page are most likely
  147. to have been introduced during the conversion of the source files to
  148. man page format. To report such errors, see
  149. https://www.kernel.org/doc/man-pages/reporting_bugs.html .