Guardian C Library Calls Reference Manual

localtime
3-106 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
localtime
The localtime function converts the calendar time pointed to by timer into a broken-
down local time, and stores this broken-down local time in a structure of type struct tm
that is provided for you. The localtime function returns the address of the structure.
Local time is the calendar time expressed for some specific time zone.
timer
points to the calendar time.
Return Value
points to the broken-down local time that is stored in a structure of type struct tm.
log
The log function computes the natural (base e) logarithm of its argument.
expr
is an expression of type double, with a value greater than zero.
Return Value
is the natural logarithm of expr. If expr is less than or equal to zero, log returns the
value HUGE_VAL and sets errno to EDOM (a domain error).
Example
This example prints “The log of 1.000000 is 0.000000.”:
#include <mathh>
#include <stdioh>
int main(void)
{
double r, x;
x = 1.0;
r = log(x);
printf("The log of %f is %f.", x, r);
}
#include <timeh>
struct tm *localtime(const time_t *timer);
#include <mathh>
double log(double expr);