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.
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...