Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル
製品コード
SW006021-1
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 374
2012 Microchip Technology Inc.
Example
#include <stdlib.h>
void
main (void)
{
udiv_t result;
unsigned num = 1234, den = 7;
result = udiv(num, den);
}
See Also
uldiv()
, div(), ldiv()
Return Value
Returns the quotient and remainder as a udiv_t structure.
ULDIV
Synopsis
#include <stdlib.h>
int uldiv (unsigned long num, unsigned long denom)
Description
The
uldiv()
function calculate the quotient and remainder of the division of number
and denom, storing the results into a uldiv_t structure which is returned.
Example
#include <stdlib.h>
void
main (void)
{
uldiv_t result;
unsigned long num = 1234, den = 7;
result = uldiv(num, den);
}
See Also
ldiv()
, udiv(), div()
Return Value
Returns the quotient and remainder as a uldiv_t structure.
UTOA
Synopsis
#include <stdlib.h>
char * utoa (char * buf, unsigned val, int base)