C++ asinh()

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

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

The function is defined in <cmath> header file.

[Mathematics] sinh-1 x = asinh(x) [In C++ Programming]

asinh() prototype [As of C++ 11 standard]

double asinh(double x);
float asinh(float x);
long double asinh(long double x);
double asinh(T x); // For integral type

asinh() Parameters

The asinh() function takes a single mandatory argument whose inverse hyperbolic sine is to be computed.

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


asinh() Return value

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


Example 1: How asinh() function works in C++?

#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;

	// result in degrees
	cout << "asinh(x) = " << result*180/PI << " degree" << endl;

	return 0;
}

When you run the program, the output will be:

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

Example 2: asinh() function with integral type

#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;

	// result in degrees
	cout << "asinh(x) = " << result*180/PI << " degree" << endl;

	return 0;
}

When you run the program, the output will be:

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