8. Mathematical Functions

#include <math.h>

Elementary Math Functions

fabs(x) - absolute value of floating-point number
sqrt(x) - square root
pow(x,y) - x to the y power, xy
ceil(x) - round up (towards ∞) to nearest integer
floor(x) - round down (towards -∞) to nearest integer
exp(x) - ex
log(x) - natural logarithm to the base e
log10(x) - logarithm to the base 10

Trigonometric Functions - all angles are in radians

sin(x) - sine
cos(x) - cosine
tan(x) - tangent
asin(x) - arcsine, angle whose sine is x
acos(x) - arccosine, angle whose cosine is x
atan(x) - arctangent, angle whose tangent is x
atan2(y,x) - arctangent, angle whose tangent is y/x.
Example:
Math: ζ = 4x103e(ln z - xy)|4-y½|/sin-1(¾πt)

   C: zeta = 4e3*exp(2*a)*(log(z)-pow(x,y))*fabs(4-sqrt(y))/asin(3*pi*t/4);
Practice!