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

div.3p (2628B)


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