C# - Math Atanh() Function
The C# Math Atanh() function is used to return inverse hyperbolic tangent of a value. The hyperbolic tangent of x is defined as:
In special cases it returns the following:
- If the argument is NaN, the method returns NaN.
- If the absolute value of argument is greater than 1, the method returns NaN.
Syntax
public static double Atanh (double x);
Parameters
x |
Specify the value. |
Return Value
Returns the hyperbolic tangent of a value.
Example:
In the below example, Atanh() function is used to find out the hyperbolic tangent of a value.
using System; class MyProgram { static void Main(string[] args) { Console.WriteLine(Math.Atanh(0.1)); Console.WriteLine(Math.Atanh(0.5)); Console.WriteLine(Math.Atanh(2)); } }
The output of the above code will be:
0.10033534773107558 0.5493061443340548 NaN
❮ C# Math Methods