@node div, math @subheading Syntax @example #include div_t div(int numerator, int denominator); @end example @subheading Description Returns the quotient and remainder of the division @var{numerator} divided by @var{denominator}. The return type is as follows: @example typedef struct @{ int quot; int rem; @} div_t; @end example @subheading Return Value The results of the division are returned. @subheading Portability @portability ansi, posix @subheading Example @example div_t d = div(42, 3); printf("42 = %d x 3 + %d\n", d.quot, d.rem); div(+40, +3) = @{ +13, +1 @} div(+40, -3) = @{ -13, -1 @} div(-40, +3) = @{ -13, -1 @} div(-40, -3) = @{ +13, -1 @} @end example