MathF.Atanh() Method in C# with Examples


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

Updated on: 12-Nov-2019

37 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements