C ++ library of commonly used functions list cmath

cmath is a library function c ++ language, which c represents the c function is a function from the standard library, math is math library functions commonly used.

cmath commonly used library functions:

int abs (int i); // Returns the integer absolute value of the parameter i
double fabs (double x); // returns the absolute value of the parameter x double
long labs (long n); // Returns Long parameter n absolute value

double exp (double x); // return the exponential e ^ x value of the
double log (double x); // return value logex
double log10 (double x) returns the value log10x
double pow (double x, double y ) Returns x ^ y values
double pow10 (int p) returns the value of 10 ^ p

double sqrt (double x) returns the value of + √x

double acos (double x) Returns x inverse cosine arccos (x) value, x is in radians
double asin (double x) Returns the arc sine arcsin x of (x) value, x is in radians
double atan (double x) Returns x anyway cut arctan (x) value, x radians
double cos (double x) returns the cosine cos x (x) of the value, x is in radians
returns the sine sin x a (x) double sin (double x ) value, x radians
double tan (double x) returns the tangent of x Tan (x) value, x is in radians

double hypot (double x, double y ) returns the length of hypotenuse (Z),
X and y are perpendicular to the length of the edge, z ^ 2 = x ^ 2 + y ^ 2

double ceil (double x) returns the smallest integer not less than x
double floor (double x) returns the largest integer not greater than x

int rand () generates a random number and returns this number

the atof Double (char nptr) converted to floating point and string nptr returns the float
Double atol (char
nptr) nptr convert string and returns the integer to long integer
Double the atof (char nptr) to convert to a double string nptr number and returns this number, error return 0
int atoi (char
nptr) to convert a string nptr into integer and returns this number, error return 0
Long atol (char * nptr) will convert the string nptr grow integer and returns this number, error return 0

Reference Links:
https://blog.csdn.net/mary19920410/article/details/63696380

Guess you like

Origin www.cnblogs.com/chendeqiang/p/11533141.html