English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C++ asinh() Function Usage and Example

C++ Library Function <cmath>

C ++The asinh() function in returns the inverse hyperbolic sine (inverse hyperbolic sine) of the radian number.

The asinh() function takes a single parameter and returns the inverse hyperbolic sine of that value in radians.

The function is<cmath>header file is defined.

 sinh-1 x = asinh(x)

asinh() prototype [from C ++ 11Standard Library]

double asinh(double x);
float asinh(float x);
long double asinh(long double x);
double asinh(T x); //are of integer type

asinh() parameters

asinh() function takes a single argument and calculates the inverse hyperbolic sine of that value.

It can be any value, negative, positive, or zero.

asinh() return value

The asinh() function returns the inverse hyperbolic sine of the argument in radians.

Example1:How does the asinh() function work in C ++working?

#include <iostream>
#include <cmath>
#define PI 3.141592654
using namespace std;
int main()
{
	double x = -6.82, result;
	result = asinh(x);
	cout << "asinh(x) = " << result << " radian " << endl;
	cout << "asinh(x) = " << result*180/PI << " degree " << endl;
	return 0;
}

The output when running the program is:

asinh(x) = -2.61834 radian
asinh(x) = -150.02 degree

Example2:An integer type asinh() function

#include <iostream>
#include <cmath>
#define PI 3.141592654
using namespace std;
int main()
{
	int x = 11;
	double result;
	result = asinh(x);
	cout << "asinh(x) = " << result << " radian " << endl;
	cout << "asinh(x) = " << result*180/PI << " degree " << endl;
	return 0;
}

The output when running the program is:

asinh(x) = 3.0931 radian
asinh(x) = 177.222 degree

  C++ Library Function <cmath>