MathF.Acosh() Method in C# with Examples


The MathF.Acosh() method in C# is used to return the hyperbolic arc-cosine of a floating-point value.

Syntax

Following is the syntax −

public static float Acosh (float val);

Above, Val is the floating-point number.

Example

Let us now see an example to implement the MathF.Acosh() method −

using System;
public class Demo {
   public static void Main(){
      float val1 = 0.1f;
      float val2 = 0.9f;
      Console.WriteLine("Angle (val1) = "+(MathF.Acosh(val1)));
      Console.WriteLine("Angle (val2) = "+(MathF.Acosh(val2)));
   }
}

Output

This will produce the following output −

Angle (val1) = NaN
Angle (val2) = NaN

Example

Let us now see another example to implement the MathF.Acosh() method −

using System;
public class Demo {
   public static void Main(){
      float val1 = 5.1f;
      float val2 = 8.9f;
      Console.WriteLine("Angle (val1) = "+(MathF.Acosh(val1)));
      Console.WriteLine("Angle (val2) = "+(MathF.Acosh(val2)));
   }
}

Output

This will produce the following output −

Angle (val1) = 2.312634
Angle (val2) = 2.876027

Updated on: 13-Nov-2019

31 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements