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