ldiv

Calculates the quotient and remainder of the division of a long integer.

Library:LibC
Classification:ANSI
Service:General C Services

Syntax

  #include <stdlib.h> 
   
  ldiv_t ldiv (
     long   number,   
     long   denom);
  

Parameters

number

(IN) Specifies the numerator.

denom

(IN) Specifies the denominator.

Return Values

Returns a structure of type ldiv_t.

Remarks

The ldiv_t structure has fields for the quotient and the remainder. It has the following syntax:

  typedef struct {
     long  quot;
     long  rem;
  } ldiv_t;
  

See Also

div