06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

pREPC+ <strong>System</strong> <strong>Calls</strong> ldiv<br />

ldiv Performs a division operation on two specified long integers.<br />

#include <br />

ldiv_t ldiv (<br />

long numer, /* numerator */<br />

long denom /* denominator */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

The ldiv() function computes the quotient and remainder of the division of the<br />

numerator numer by the denominator denom. If the division is inexact, the resulting<br />

quotient is the integer of lesser magnitude that is the nearest to the algebraic<br />

quotient. If the result cannot be represented, the behavior is undefined; otherwise,<br />

quot * denom + rem is equal to numer.<br />

numer Specifies the numerator.<br />

denom Specifies the denominator.<br />

The ldiv() function returns a structure of type ldiv_t. This structure is defined<br />

in stdlib.h as follows:<br />

typedef struct {<br />

long quot; /* the quotient */<br />

long rem; /* the remainder */<br />

} ldiv_t;<br />

None.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 3-87<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!