Ads by ProfitSence
Close

C++ atanh()

Last Updated on Wednesday 5th Oct 2022

atanh

The C++ atanh() function returns the arc hyperbolic tangent of a number in radians and it takes a single argument.

Syntax

			
					 atanh(x)

			
	

Parameters

The atanh() function takes a one argument in the range of [-1, 1]

If the value is greater than 1 or less than -1, a domain error occurs.

Return value

Returns the inverse hyperbolic tangent of the argument passed to it.

atanh math

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

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

			
	

arctanh

Example 1 : C++ atanh()

			
					#include <stdio.h>
#include <math.h>

int main () {
  double param, result;
  param = tanh(4);
  result = atanh(param) ;
  printf ("The area hyperbolic tangent of %f is %f.\n", param, result);
  return 0;
}

			
	

Output

			
					The area hyperbolic tangent of 0.999329 is 4.000000.

			
	

Example 2 : C++ atanh() With Negative Value

			
					#include <stdio.h>
#include <math.h>

int main () {
  double param, result;
  param = -1;
  result = atanh(param) ;
  printf ("The area hyperbolic tangent of %f is %f.\n", param, result);
  return 0;
}

			
	

Output

			
					The area hyperbolic tangent of -1.000000 is -inf.