Math.h/cmath (c + +) Math function library
13 Angle function
Double sin (double);
Double cos (double);
Double tan (double);
2 Inverse Trigonometric Functions
Double asin (double); Results are between [-PI/2,PI/2]
Double ACOs (double); Results between [0, PI]
Double Atan (double); Tangent (primary), the result is between [-PI/2,PI/2]
Double atan2 (double, double); Tangent (integer circle value), the result is between [-PI/2,PI/2]
3 Hyperbolic trigonometric Functions
Double Sinh (double);
Double cosh (double);
Double Tanh (double);
4 exponent and logarithm
Double exp (double);
Double pow (double, double); Double pow (double base, double exponent); Long double pow (long double base, long double exponent); Float POW (float base, float exponent); Double pow (double base, int exponent); Long double pow (long double base, int exponent);
Double sqrt (double);
Double log (double); Logarithm with e as the base
Double log10 (double); Ln=log (n), log10 (n)
But there is no 2-based function. You can use the formula to solve: log2 (n) =log10 (n)/log10 (2). VS2010, log (243.0)/log (3.0), the calculated result is actually 4, the answer is wrong. Sometimes I use the log (243.0+0.1)/log (3.0) in this format to take the logarithm.
5 rounding
Double ceil (double); Take the whole
Double floor (double); Remove the whole
6 absolute Value
Double fabs (double);
7 Standardized floating-point numbers
Double Frexp (double f, int *p); Standard floating-point number, F = x *2^p, known F for X, p (x between [0.5, 1])
Double Ldexp (double x, int p); In contrast to Frexp, known as x, P F
8 Rounding and fetching
Double Modf (double, double*); Returns the integer part of the parameter by the pointer, returning the decimal part
Double Fmod (double, double); Returns the remainder of the divide between two parameters
9 square root
Double sqrt (double x); float sqrt (float x); Long double sqrt (long double x);