Table of Contents
C++ Programming language mathematical function
In this tutorial, we will disuss the concept of C++ Programming language mathematical function. Cpp language privides bulit-in methomaticla function for methamatical calculation.
C++ maths functions
1. abs(x) – return the absolute value of an integer
Syntex
int abs(int x);
Example for abs() function
2. fabs(x) – return the absolute value of a floating point number
Syntex
double fabs(double x);
Example for fabs() function
3 ceil(x) – return the value of rounds up to a whole number
Syntex
double ceil(double x);
Example for ceil() function
4. floor(x) – return the value of rounds down to a whole number
Syntex
double floor(double x);
Example for floor() function
5. pow(x,y) – return the value of x to the power of y, if x is negative , y must be an integer, if x is zero, y must be a positive integer.
Syntex
double pow(double x, double y);
Example for pow() function
6. sqrt(x) – return the value of the positive square root of x
Syntex
double sqrt(int x);
Example for sqrt() function
7. sin(x) – return the value of the positive sin value of x
Syntex
double sin(double x);
Example for sin() function
8. cos(x) – return the value of cosine of x
Syntex
double cos(double x);
Example for cos() function
9. tan(x) – return the value of tan value of x
Syntex
double tan(double x);
Example for tan() function
10. asin(x) – return the value of arc sine value of x
Syntex
double asin(double x);
Example for asin() function
11. acos(x) – return the value of arc cosine value of x
Syntex
double acos(double x);
Example for acos() function
12. atan(x) – return the value of arc tangent value of x
Syntex
double atan(double x);
Example for atan() function
13. sinh(x) – return the value of hyperbolic sine value of x
Syntex
double sinh (double x);
Example for sinh() function
14. cosh(x) – return the value of hyperbolic cosine value of x
Syntex
double cosh (double x);
Example for cosh() function
15. tanh(x) – return the value of hyperbolic tangent value of x
Syntex
double tanh (double x);
Example for tanh() function
16. exp(x) – return the value of exponential value of x
Syntex
double exp (double x);
Example for exp() function
17. log(x) – return the value of log value of x
Syntex
double log (double x);
Example for log() function
18. log10(x) – return the value of (base ten) log10 value of x
Syntex
double log10 (double x);
Example for log10() function