Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
Library Functions
 2012 Microchip Technology Inc.
DS52053B-page 373
Example
#include <stdio.h>
#include <ctype.h>
#include <string.h>
void 
main (void)
{
    char * array1 = "aBcDE";
    int i;
    for(i=0;i < strlen(array1); ++i) {
        printf("%c", tolower(array1[i]));
    }
    printf("n");
}
See Also
islower()
, isupper(), isascii(), et. al.
TRUNC 
Synopsis
#include <math.h>
 
double trunc (double x)
Description
The 
trunc
 function rounds the argument to the nearest integer value, in floating-point 
format, that is not larger in magnitude than the argument.
Example
#include <math.h>
void 
main (void)
{
    double input, rounded;
    input = 1234.5678;
    rounded = trunc(input);
}
See Also
round()
UDIV 
Synopsis
#include <stdlib.h>
 
int udiv (unsigned num, unsigned denom)
Description
The 
udiv()
 function calculate the quotient and remainder of the division of number 
and denom, storing the results into a udiv_t structure which is returned.