The MathF.Atanh() method in C# returns the hyperbolic arc-tangent of a floating-point value.
Syntax
Following is the syntax −
public static float Atanh (float val);
Example
Let us now see an example to implement the MathF.Atanh() method −
using System;
public class Demo {
public static void Main(){
float val1 = 25f;
float val2 = 15f;
Console.WriteLine("Return value (val1) = "+(MathF.Atanh(val1)));
Console.WriteLine("Return value (val2) = "+(MathF.Atanh(val2)));
}
}Output
This will produce the following output −
Return value (val1) = NaN Return value (val2) = NaN
Example
Let us now see another example to implement the MathF.Atanh() method −
using System;
public class Demo {
public static void Main(){
float val1 = 5.8f;
float val2 = 2.9f;
Console.WriteLine("Return value (val1) = "+(MathF.Atanh(val1)));
Console.WriteLine("Return value (val2) = "+(MathF.Atanh(val2)));
}
}Output
This will produce the following output −
Return value (val1) = NaN Return value (val2) = NaN