11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

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.

Library FunctionsLDIVSynopsis#include ldiv_t ldiv (long number, long denom)DescriptionThe ldiv() routine divides the numerator by the denominator, computing the quotient and the remainder.The sign of the quotient is the same as that of the mathematical quotient. Its absolute value isthe largest integer which is less than the absolute value of the mathematical quotient.The ldiv() function is similar to the div() function, the difference being that the arguments andthe members of the returned structure are all of type long int.Example#include #include voidmain (void){ldiv_t lt;}lt = ldiv(1234567, 12345);printf("Quotient = %ld, remainder = %ld\n", lt.quot, lt.rem);See Alsodiv()Return ValueReturns a structure of type ldiv_t157

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

Saved successfully!

Ooh no, something went wrong!