222
"C" Programming Guide For Optimus S/R
4.4 Mathematical Functions: <math.h>
Mathematical functions are listed below. All of them return a value of double.
In this list, types of variables are as follows.
double x, y;
int n;
sin (x)
cos (x)
tan (x)
asin (x)
acos (x)
atan (x)
atan2 (y, x)
sinh (x)
cosh (x)
tanh (x)
exp (x)
log (x)
log10 (x)
pow (x, y)
sqrt (x)
ceil (x)
floor (x)
fabs (x)
ldexp (x, n)
frexp
*exp)
sine of x
cosine of x
tangent of x
arc sine of x, in the range [-π/2, π/2] radians, x ∈ [−1, 1].
arc cosine of x, in the range [0,π] radians, x ∈ [−1, 1].
arc tangent of x, in the range [-π/2, π/2] radians.
arc tangent of y/x, in the range [-π, π] radians.
hyperbolic sine of x
hyperbolic cosine of x
hyperbolic tangent of x
base e raised to the power of x
log(x), x > 0
log to the base 10 of x, x > 0
x raised to the power y
square root of x
the smallest integer no less than x
the largest integer not greater than x
absolute value of x
x multiplied by 2 raised to the power of n
(x,
int
decompose x into two parts: a mantissa between 0.5 and 1
(returned by the function) and an exponent returned as exp.
Scientific notation works like this: x = mantissa * (2 ^ exp)
If x = 0, both parts of the result are zero.