MathF.Exp() Method in C# with Examples



The MathF.Exp() method in C# returns the raised to the specified power.

Syntax

Following is the syntax −

public static float Exp (float val);

Above, Val is the floating-point number.

Example

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

using System;
class Demo {
   public static void Main(){
      float val = 90f;
      float res = MathF.Exp(val);
      Console.WriteLine("MathF.Exp() = "+res);
   }
}

Output

This will produce the following output −

MathF.Exp() = Infinity

Example

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

using System;
class Demo {
   public static void Main(){
      float val = 0.00f;
      float res = MathF.Exp(val);
      Console.WriteLine("MathF.Exp() = "+res);
   }
}

Output

This will produce the following output −

MathF.Exp() = 1
Updated on: 2019-11-14T06:13:38+05:30

92 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements