MathF.Sinh() Method in C# with Examples


The MathF.Sinh() method in C# returns the hyperbolic sine of a floating-point argument.

Syntax

Following is the syntax −

public static float Sinh (float val);

Above, Val is the number whose hyperbolic sine is to be returned.

Example

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

using System;
public class Demo {
   public static void Main(){
      float val1 = float.PositiveInfinity;
      float val2 = float.NegativeInfinity;
      float val3 = (20f * (MathF.PI)) / 180;
      Console.WriteLine("MathF.Sinh(val1) = "+MathF.Sinh(val1));
      Console.WriteLine("MathF.Sinh(val2) = "+MathF.Sinh(val2));
      Console.WriteLine("MathF.Sinh(val3) = "+MathF.Sinh(val3));
   }
}

Output

This will produce the following output −

MathF.Sinh(val1) = Infinity
MathF.Sinh(val2) = -Infinity
MathF.Sinh(val3) = 0.356198

Example

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

using System;
public class Demo {
   public static void Main(){
      float val1 = 55f;
      float val2 = float.NaN;
      Console.WriteLine("MathF.Sinh(val1) = "+MathF.Sinh(val1));
      Console.WriteLine("MathF.Sinh(val2) = "+MathF.Sinh(val2));
   }
}

Output

This will produce the following output −

MathF.Sinh(val1) = 3.847393E+23
MathF.Sinh(val2) = NaN
raja
Published on 07-Nov-2019 07:04:49
Advertisements