Home > Electronics Tutorials > C Language Tutorial > stdlib.h - Math Functions - div

C Language Programming Library Reference Guide

stdlib.h - Math Functions - div

Declaration: div_t div(int numer, int denom); Divides numer (numerator) by denom (denominator). The result is stored in the structure div_t which has two members: int qout;
int rem;
Where quot is the quotient and rem is the remainder. In the case of inexact division, quot is rounded down to the nearest integer. The value numer is equal to quot * denom + rem.

The value of the division is returned in the structure.

Note: To report broken links or to submit your projects, tutorials please email to Webmaster

Discover

     more......