Categories: C++

C++ Programming language mathematical function

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

abs() nfunction

2. fabs(x) – return the absolute value of a floating point number

Syntex

double fabs(double x);

Example for fabs() function



fabs() function Example

3 ceil(x) – return the value of rounds up to a whole number

Syntex

double ceil(double x);

Example for ceil() function

ceil() function Example

4. floor(x) – return the value of rounds down to a whole number

Syntex

double floor(double x);

Example for floor() function

floor() function Example

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

pow() function Example

6. sqrt(x) – return the value of  the positive square root of x

Syntex

double sqrt(int x);

Example for sqrt() function

sqrt() function example

 

7. sin(x) – return the value of the positive sin value of x

Syntex

double sin(double x);

Example for sin() function

sin() function Example



8. cos(x) – return the value of cosine of x

Syntex

double cos(double x);

Example for cos() function

cos() function Example

 

9. tan(x) – return the value of  tan value of x

Syntex

double tan(double x);

Example for tan() function

tan() function Example

 

10. asin(x) – return the value of  arc sine value of x

Syntex

double asin(double x);

Example for asin() function

asin() function Example

11. acos(x) – return the value of  arc cosine value of x

Syntex

double acos(double x);

Example for acos() function

acos() function Example

12. atan(x) – return the value of  arc tangent value of x

Syntex

double atan(double x);

Example for atan() function

atan() function Example

 

13. sinh(x) – return the value of  hyperbolic sine value of x

Syntex

double sinh (double x);

Example for sinh() function

sinh() function Example

14. cosh(x) – return the value of  hyperbolic cosine value of x

Syntex

double cosh (double x);

Example for cosh() function


cosh() function Example

15. tanh(x) – return the value of  hyperbolic tangent value of x

Syntex

double tanh (double x);

Example for tanh() function

tanh() function Example

16. exp(x) – return the value of  exponential value of x

Syntex

double exp (double x);

Example for exp() function

exp() function Exanmple

17. log(x) – return the value of  log value of x

Syntex

double log (double x);

Example for log() function

log() function Example

18. log10(x) – return the value of  (base ten) log10 value of x

Syntex

double log10  (double x);

Example for log10() function

log10() function Example













Karmehavannan

Recent Posts

Subtract two numbers using method overriding

Subtract two numbers using method overriding   Program 1

4 weeks ago

PHP Star triangle Pattern program

PHP Star triangle Pattern program Here's a simple Java program that demonstrates how to print…

4 weeks ago

Using function or method to Write temperature conversion : Fahrenheit into Celsius

Using Function or Method to Write to temperature conversion: Fahrenheit into Celsius In this article,…

1 year ago

Function or method:temperature conversion from Fahrenheit into Celsius – Entered by user

Function or method of temperature conversion from Fahrenheit into Celsius In this article, we will…

1 year ago

Write temperature conversion program: Fahrenheit into Celsius

Write temperature conversion program: from Fahrenheit to Celsius In this article, we will discuss the…

1 year ago

How to write a program to convert Fahrenheit into Celsius

How to write a program to convert Fahrenheit into Celsius In this article, we will…

1 year ago

This website uses cookies.