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

remainder.3p (4042B)


  1. '\" et
  2. .TH REMAINDER "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. remainder,
  12. remainderf,
  13. remainderl
  14. \(em remainder function
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <math.h>
  19. .P
  20. double remainder(double \fIx\fP, double \fIy\fP);
  21. float remainderf(float \fIx\fP, float \fIy\fP);
  22. long double remainderl(long double \fIx\fP, long double \fIy\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 return the floating-point remainder
  30. .IR r =\c
  31. .IR x \-\c
  32. .IR ny
  33. when
  34. .IR y
  35. is non-zero. The value
  36. .IR n
  37. is the integral value nearest the exact value
  38. .IR x /\c
  39. .IR y .
  40. When |\|\fIn\fR\-\fIx\fR/\fIy\fR\||=\(12, the value
  41. .IR n
  42. is chosen to be even.
  43. .P
  44. The behavior of
  45. \fIremainder\fR()
  46. shall be independent of the rounding mode.
  47. .SH "RETURN VALUE"
  48. Upon successful completion, these functions shall return the
  49. floating-point remainder
  50. .IR r =\c
  51. .IR x \-\c
  52. .IR ny
  53. when
  54. .IR y
  55. is non-zero.
  56. .P
  57. On systems that do not support the IEC 60559 Floating-Point option, if
  58. .IR y
  59. is zero, it is implementation-defined whether a domain error occurs or
  60. zero is returned.
  61. .P
  62. If
  63. .IR x
  64. or
  65. .IR y
  66. is NaN, a NaN shall be returned.
  67. .P
  68. If
  69. .IR x
  70. is infinite or
  71. .IR y
  72. is 0 and the other is non-NaN, a domain error shall occur, and a NaN
  73. shall be returned.
  74. .SH ERRORS
  75. These functions shall fail if:
  76. .IP "Domain\ Error" 12
  77. The
  78. .IR x
  79. argument is \(+-Inf, or the
  80. .IR y
  81. argument is \(+-0 and the other argument is non-NaN.
  82. .RS 12
  83. .P
  84. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  85. non-zero, then
  86. .IR errno
  87. shall be set to
  88. .BR [EDOM] .
  89. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  90. non-zero, then the invalid floating-point exception shall be raised.
  91. .RE
  92. .P
  93. These functions may fail if:
  94. .IP "Domain\ Error" 12
  95. The
  96. .IR y
  97. argument is zero.
  98. .RS 12
  99. .P
  100. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  101. non-zero, then
  102. .IR errno
  103. shall be set to
  104. .BR [EDOM] .
  105. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  106. non-zero, then the invalid floating-point exception shall be raised.
  107. .RE
  108. .LP
  109. .IR "The following sections are informative."
  110. .SH EXAMPLES
  111. None.
  112. .SH "APPLICATION USAGE"
  113. On error, the expressions (\fImath_errhandling\fR & MATH_ERRNO) and
  114. (\fImath_errhandling\fR & MATH_ERREXCEPT) are independent of each
  115. other, but at least one of them must be non-zero.
  116. .SH RATIONALE
  117. None.
  118. .SH "FUTURE DIRECTIONS"
  119. None.
  120. .SH "SEE ALSO"
  121. .IR "\fIabs\fR\^(\|)",
  122. .IR "\fIdiv\fR\^(\|)",
  123. .IR "\fIfeclearexcept\fR\^(\|)",
  124. .IR "\fIfetestexcept\fR\^(\|)",
  125. .IR "\fIldiv\fR\^(\|)"
  126. .P
  127. The Base Definitions volume of POSIX.1\(hy2017,
  128. .IR "Section 4.20" ", " "Treatment of Error Conditions for Mathematical Functions",
  129. .IR "\fB<math.h>\fP"
  130. .\"
  131. .SH COPYRIGHT
  132. Portions of this text are reprinted and reproduced in electronic form
  133. from IEEE Std 1003.1-2017, Standard for Information Technology
  134. -- Portable Operating System Interface (POSIX), The Open Group Base
  135. Specifications Issue 7, 2018 Edition,
  136. Copyright (C) 2018 by the Institute of
  137. Electrical and Electronics Engineers, Inc and The Open Group.
  138. In the event of any discrepancy between this version and the original IEEE and
  139. The Open Group Standard, the original IEEE and The Open Group Standard
  140. is the referee document. The original Standard can be obtained online at
  141. http://www.opengroup.org/unix/online.html .
  142. .PP
  143. Any typographical or formatting errors that appear
  144. in this page are most likely
  145. to have been introduced during the conversion of the source files to
  146. man page format. To report such errors, see
  147. https://www.kernel.org/doc/man-pages/reporting_bugs.html .