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

ldiv.3p (3091B)


  1. '\" et
  2. .TH LDIV "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. ldiv,
  12. lldiv
  13. \(em compute quotient and remainder of a long division
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <stdlib.h>
  18. .P
  19. ldiv_t ldiv(long \fInumer\fP, long \fIdenom\fP);
  20. lldiv_t lldiv(long long \fInumer\fP, long long \fIdenom\fP);
  21. .fi
  22. .SH DESCRIPTION
  23. The functionality described on this reference page is aligned with the
  24. ISO\ C standard. Any conflict between the requirements described here and the
  25. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  26. .P
  27. These functions shall compute the quotient and remainder of the
  28. division of the numerator
  29. .IR numer
  30. by the denominator
  31. .IR denom .
  32. If the division is inexact, the resulting quotient is the
  33. .BR long
  34. integer (for the
  35. \fIldiv\fR()
  36. function) or
  37. .BR "long long"
  38. integer (for the
  39. \fIlldiv\fR()
  40. function) of lesser magnitude that is the nearest to the algebraic
  41. quotient. If the result cannot be represented, the behavior is
  42. undefined; otherwise, \fIquot\fP\ *\ \fIdenom\fP+\fIrem\fP shall equal
  43. .IR numer .
  44. .SH "RETURN VALUE"
  45. The
  46. \fIldiv\fR()
  47. function shall return a structure of type
  48. .BR ldiv_t ,
  49. comprising both the quotient and the remainder. The structure shall
  50. include the following members, in any order:
  51. .sp
  52. .RS 4
  53. .nf
  54. long quot; /* Quotient */
  55. long rem; /* Remainder */
  56. .fi
  57. .P
  58. .RE
  59. .P
  60. The
  61. \fIlldiv\fR()
  62. function shall return a structure of type
  63. .BR lldiv_t ,
  64. comprising both the quotient and the remainder. The structure shall
  65. include the following members, in any order:
  66. .sp
  67. .RS 4
  68. .nf
  69. long long quot; /* Quotient */
  70. long long rem; /* Remainder */
  71. .fi
  72. .P
  73. .RE
  74. .SH ERRORS
  75. No errors are defined.
  76. .LP
  77. .IR "The following sections are informative."
  78. .SH EXAMPLES
  79. None.
  80. .SH "APPLICATION USAGE"
  81. None.
  82. .SH RATIONALE
  83. None.
  84. .SH "FUTURE DIRECTIONS"
  85. None.
  86. .SH "SEE ALSO"
  87. .IR "\fIdiv\fR\^(\|)"
  88. .P
  89. The Base Definitions volume of POSIX.1\(hy2017,
  90. .IR "\fB<stdlib.h>\fP"
  91. .\"
  92. .SH COPYRIGHT
  93. Portions of this text are reprinted and reproduced in electronic form
  94. from IEEE Std 1003.1-2017, Standard for Information Technology
  95. -- Portable Operating System Interface (POSIX), The Open Group Base
  96. Specifications Issue 7, 2018 Edition,
  97. Copyright (C) 2018 by the Institute of
  98. Electrical and Electronics Engineers, Inc and The Open Group.
  99. In the event of any discrepancy between this version and the original IEEE and
  100. The Open Group Standard, the original IEEE and The Open Group Standard
  101. is the referee document. The original Standard can be obtained online at
  102. http://www.opengroup.org/unix/online.html .
  103. .PP
  104. Any typographical or formatting errors that appear
  105. in this page are most likely
  106. to have been introduced during the conversion of the source files to
  107. man page format. To report such errors, see
  108. https://www.kernel.org/doc/man-pages/reporting_bugs.html .