MathF.Asinh() Method in C# with Examples

The MathF.Asinh() method in C# returns the inverse hyperbolic sine (arc hyperbolic sine) of a specified single-precision floating-point number. This method is part of the System namespace and is commonly used in mathematical calculations involving hyperbolic functions.

The inverse hyperbolic sine function is the inverse of the hyperbolic sine function. For any real number x, Asinh(x) returns the value y such that sinh(y) = x.

Syntax

Following is the syntax for the MathF.Asinh() method −

public static float Asinh(float val);

Parameters

  • val − A single-precision floating-point number representing the hyperbolic sine value for which to find the inverse.

Return Value

The method returns a float value representing the hyperbolic arc-sine of the input parameter. The return value is in radians and ranges from negative infinity to positive infinity.

Special cases include −

  • If val is NaN, the method returns NaN.
  • If val is positive infinity, the method returns positive infinity.
  • If val is negative infinity, the method returns negative infinity.
  • If val is 0, the method returns 0.

MathF.Asinh() Function Visualization -? +? +? -? Asinh(0) = 0 Asinh(x) x ? +? y ? +?

Using MathF.Asinh() with Positive Values

Example

using System;

public class Demo {
   public static void Main() {
      float val1 = 1.2f;
      float val2 = 45.5f;
      Console.WriteLine("Asinh(" + val1 + ") = " + MathF.Asinh(val1));
      Console.WriteLine("Asinh(" + val2 + ") = " + MathF.Asinh(val2));
   }
}

The output of the above code is −

Asinh(1.2) = 1.015973
Asinh(45.5) = 4.51098

Using MathF.Asinh() with Various Values

Example

using System;

public class Demo {
   public static void Main() {
      float val1 = 0.1f;
      float val2 = -2.5f;
      float val3 = 0.0f;
      Console.WriteLine("Asinh(" + val1 + ") = " + MathF.Asinh(val1));
      Console.WriteLine("Asinh(" + val2 + ") = " + MathF.Asinh(val2));
      Console.WriteLine("Asinh(" + val3 + ") = " + MathF.Asinh(val3));
   }
}

The output of the above code is −

Asinh(0.1) = 0.09983408
Asinh(-2.5) = -1.647231
Asinh(0) = 0

Using MathF.Asinh() with Special Values

Example

using System;

public class Demo {
   public static void Main() {
      float positiveInfinity = float.PositiveInfinity;
      float negativeInfinity = float.NegativeInfinity;
      float nanValue = float.NaN;
      
      Console.WriteLine("Asinh(+?) = " + MathF.Asinh(positiveInfinity));
      Console.WriteLine("Asinh(-?) = " + MathF.Asinh(negativeInfinity));
      Console.WriteLine("Asinh(NaN) = " + MathF.Asinh(nanValue));
   }
}

The output of the above code is −

Asinh(+?) = ?
Asinh(-?) = -?
Asinh(NaN) = NaN

Conclusion

The MathF.Asinh() method calculates the inverse hyperbolic sine of a single-precision floating-point number. It handles all real numbers and special values like infinity and NaN appropriately, making it useful for advanced mathematical computations involving hyperbolic functions.

Updated on: 2026-03-17T07:04:36+05:30

152 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements