How to use atanh() function to get the arc hyperbolic tangent of N in C

1 Answer

0 votes
#include <stdio.h>     
#include <math.h>
  
int main(int argc, char **argv)
{
	printf("atanh(-1) = %.6f\n", atanh(-1));
	printf("atanh(0) = %.6f\n", atanh(0));
	printf("atanh(0.9) = %.6f\n", atanh(0.9));
 
    return 0;
}
 
// 1.#QNAN0 = Quiet NaNs (qNaNs) do not raise any additional exception
// "NAN" is "not-a-number" - applies to float and double
 
/*
run:
  
atanh(-1) = -1.#INF00
atanh(0) = 0.000000
atanh(0.9) = 1.472219

*/

 



answered Mar 13, 2016 by avibootz
edited Mar 14, 2016 by avibootz
...