Hardware Reference
In-Depth Information
Note that clock_t and time_t are long-data types returned by clock and
time functions, respectively, whilst tm is a structure returned (or used by) the
asctime , gmtime , localtime , and mktime functions.
Math.h
The math.h library provides access to the following maths functions:
abs Return absolute value of integer parameter
acos Calculate arccosine
asin Calculate arcsine
atan Calculate arctangent
atan2
Calculate arctangent with two parameters
Convert string to double
atof
Return the smallest integer that is greater or equal to x
ceil
Calculate cosine
cos
Calculate hyperbolic cosine
cosh
Calculate exponential
exp
Return absolute value of floating point
fabs
Round down value
floor
Return remainder of floating-point division
fmod
Get mantissa and exponent of floating-point value
frexp
Return absolute value of long-integer parameter
labs
Get floating-point value from mantissa and exponent
ldexp
Calculate natural logarithm
log
Calculate logarithm base-10
log10
Separate floating-point value into fractional and integer parts
modf
Calculate numeric power
pow
Calculate sine
sin
Calculate hyperbolic sine
sinh
Calculate square root
sqrt
Calculate tangent
tan
Calculate hyperbolic tangent
tanh
Using C functions
The fundamental building blocks of C programs are called functions . Once
written, functions (like BASIC procedures) may be incorporated in a variety
of programs whenever the need arises. For example, the following function
definition provides a delay:
delay()
{
long x;
for (x = l; x<200000; ++x);
}
The delay function is called from a main program by a statement of the form:
delay()
Search WWH ::




Custom Search