Microchip Technology SW006021-1N 用户手册
Library Functions
2012 Microchip Technology Inc.
DS52053B-page 341
Return Value
The return value is the integer
i
added to the exponent of the floating-point value
f
.
LDIV
Synopsis
#include <stdlib.h>
ldiv_t ldiv (long number, long denom)
Description
The
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 is the largest integer which is less than the absolute value
of the mathematical quotient.
quotient. Its absolute value is the 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 and the members of the returned structure are all of type
long int
.
Example
#include <stdlib.h>
#include <stdio.h>
void
main (void)
{
ldiv_t lt;
lt = ldiv(1234567, 12345);
printf("Quotient = %ld, remainder = %ld\n", lt.quot, lt.rem);
}
See Also
div()
, uldiv(), udiv()
Return Value
Returns a structure of type
ldiv_t
LOCALTIME
Synopsis
#include <time.h>
struct tm * localtime (time_t * t)
Description
The
localtime()
function converts the time pointed to by
t
which is in seconds since
00:00:00 on Jan 1, 1970, into a broken down time stored in a structure as defined in
time.h
. The routine
localtime()
takes into account the contents of the global integer
time_zone
. This should contain the number of minutes that the local time zone is
westward of Greenwich. On systems where it is not possible to predetermine this value,
localtime()
will return the same result as
gmtime()
.