home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / stdlib / lldiv.txh < prev    next >
Encoding:
Text File  |  1996-05-20  |  737 b   |  39 lines

  1. @node lldiv, math
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <stdlib.h>
  6.  
  7. lldiv_t lldiv(long long numerator, long long denomonator);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. Returns the quotient and remainder of the division @var{numberator}
  13. divided by @var{denomonator}.  The return type is as follows:
  14.  
  15. @example
  16. typedef struct @{
  17.   long long quot;
  18.   long long rem;
  19. @} lldiv_t;
  20. @end example
  21.  
  22. @subheading Return Value
  23.  
  24. The results of the division are returned.
  25.  
  26. @subheading Example
  27.  
  28. @example
  29. lldiv_t l = lldiv(42, 3);
  30. printf("42 = %lld x 3 + %lld\n", l.quot, l.rem);
  31.  
  32. lldiv(+40, +3) = @{ +13, +1 @}
  33. lldiv(+40, -3) = @{ -13, -1 @}
  34. lldiv(-40, +3) = @{ -13, -1 @}
  35. lldiv(-40, -3) = @{ +13, -1 @}
  36.  
  37. @end example
  38.  
  39.