Arithmetic Functions

Function Declaration Description Header File
int abs(int); Absolute value cstdlib
long labs(long); Absolute value cstdlib
double fabs(double); Absolute value cmath
double sqrt(double); Square root cmath
double pow(double, double); Returns the first argument raised to the power of the second argument. cmath
double exp(double); Returns e (base of the natural logarithm) to the power of its argument. cmath
double log(double); Natural logarithm (ln) cmath
double log10(double); Base 10 logarithm cmath
double ceil(double); Returns the smallest integer that is greater than or equal to its argument. cmath
double floor(double); Returns the largest integer that is less than or equal to its argument. cmath