ldiv()

compute integer quotient and remainder of long integer division 

Function


SYNOPSIS

#include <stdlib.h>

ldiv_t ldiv(long numer, long denom);


DESCRIPTION

The ldiv() function computes the quotient and remainder of the division of the numerator numer by the denominator denom. If the division is inexact, the resulting quotient is the long integer of lesser magnitude that is the nearest to the algebraic quotient. If the result cannot be represented, the behavior is undefined; otherwise, quot * denom + rem equals numer.


PARAMETERS

numer 

Is the numerator.

denom 

Is the denominator.


RETURN VALUES

The ldiv() function returns a structure of type ldiv_t, comprising both the quotient and the remainder. The structure includes the members, long quot, the quotient, and long rem, the remainder.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
div()


PTC MKS Toolkit 10.0 Documentation Build 6.