Mathematical functions

#include <math.h>
void main(void) {
  printf("%f", sqrt(16)); // square root
  printf("%f", ceil(1.4)); // round up (round)
  printf("%f", floor(1.4)); // round up (round)
  printf("%f", pow(4, 3)); // x(4) to the power of y(3)
}

  • abs(x) absolute value
  • acos(x) arc cosine value
  • asin(x) arc sine
  • atan(x) arc tangent
  • cbrt(x) cube root
  • cos(x) cosine
  • the value of exp(x) Ex
  • sin(x) the sine of x
  • tangent of tan(x) angle
Comments