home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man3 / ldiv.3 < prev    next >
Encoding:
Text File  |  1975-06-26  |  877 b   |  44 lines

  1. .th LDIV III 5/7/73
  2. .sh NAME
  3. ldiv, lrem \*- long division
  4. .sh SYNOPSIS
  5. .ft B
  6. ldiv(hidividend, lodividend, divisor)
  7. .s3
  8. lrem(hidividend, lodividend, divisor)
  9. .ft R
  10. .sh DESCRIPTION
  11. The
  12. concatenation of the signed
  13. 16-bit
  14. .it hidividend
  15. and the unsigned 16-bit
  16. .it lodividend
  17. is divided by
  18. \fIdivisor\fR.
  19. The 16-bit signed quotient is returned by
  20. .it ldiv
  21. and the 16-bit signed remainder is returned by
  22. .it lrem.
  23. Divide check and erroneous results
  24. will occur
  25. unless the magnitude of the
  26. divisor is greater than that of the high-order
  27. dividend.
  28. .s3
  29. An integer division of an unsigned
  30. dividend by a signed divisor may
  31. be accomplished by
  32. .s3
  33.     quo = ldiv(0, dividend, divisor);
  34. .s3
  35. and similarly for the remainder operation.
  36. .s3
  37. Often both the quotient and the remainder are wanted.
  38. Therefore
  39. .it ldiv
  40. leaves a remainder in the external cell
  41. .it ldivr.
  42. .sh BUGS
  43. No divide check check.
  44.