Tuesday 12 February 2013

C Programming: Mathematical Functions

Functions Meaning
Trigonometric
acos(x) Arc cosine of x
asin(x) Arc sine of x
atan(x) Arc tangent of x
atan 2(x,y) Arc tangent of x/y
cos(x) Cosine of x
sin(x) Sine of x
tan(x) Tangent of x
Hyperbolic
cosh(x) Hyperbolic cosine of x
sinh(x) Hyperbolic sine of x
tanh(x) Hyperbolic tangent of x
Other Functions
ceil(x') x rounded up to nearest integer
exp(x) e to the power x (e^x)
fabs(x) Absolute value of x
floor(x) x rounded down to the nearest interger
fmod(x,y) Remainder of x/y
log(x) Natural log of x, x>0
log10(x) Base 10 log of x, x>0
pow(x,y) x to the power y
sqrt(x) Square of x, x>=0
Remember this: To use Math functions in C program, you mush include header file #include<math.h>

No comments:

Post a Comment

Comment