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)
sine of x
cos (x)
cosine of x
tan (x)
tangent of x
asin (x)
arc sine of x, in the range [-
π/2, π/2
] radians, x
∈ [−1, 1].
acos (x)
arc cosine of x, in the range [0,
π
] radians, x
∈ [−1, 1].
atan (x)
arc tangent of x, in the range [-
π/2, π/2
] radians.
atan2 (y, x)
arc tangent of y/x, in the range [-
π, π
] radians.
sinh (x)
hyperbolic sine of x
cosh (x)
hyperbolic cosine of x
tanh (x)
hyperbolic tangent of x
exp (x)
base e raised to the power of x
log (x)
log(x), x > 0
log10 (x)
log to the base 10 of x, x > 0
pow (x, y)
x raised to the power y
sqrt (x)
square root of x
ceil (x)
the smallest integer no less than x
floor (x)
the largest integer not greater than x
fabs (x)
absolute value of x
ldexp (x, n)
x multiplied by 2 raised to the power of n
frexp (x, int
*exp)
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.
Summary of Contents for Optimus R
Page 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Page 6: ......
Page 8: ...2 C Programming Guide For Optimus S R...
Page 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Page 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Page 24: ...18 C Programming Guide For Optimus S R...
Page 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...