MathF.Exp() Method in C# with Examples Last Updated : 04 Apr, 2019 Comments Improve Suggest changes Like Article Like Report In C#, Exp(Single) is a MathF class method which is used to return the e raised to the specified power. Here e is a mathematical constant whose value is approximately 2.71828. Syntax: public static float Exp (float x); Here, x is the required number of type System.Single which specifies a power. Return Type: It returns a number e raised to the power x of type System.Single. Note: If x is equal to NaN then the return value will be NaN. If x is equal to PositiveInfinity then the return value will be Infinity. If x is equal to NegativeInfinity then the return value will be 0. Example 1: CSharp // C# Program to illustrate the // MathF.Exp(Single) Method using System; class Geeks { // Main Method public static void Main() { // using the method Console.WriteLine(MathF.Exp(7.0f)); Console.WriteLine(MathF.Exp(458.95f)); Console.WriteLine(MathF.Exp(9.487f)); Console.WriteLine(MathF.Exp(0.00f)); } } Output: 1096.633 Infinity 13187.18 1 Example 2: CSharp // C# Program to illustrate the // MathF.Exp(Single) Method by // taking NaN, PositiveInfinity // and NegativeInfinity] using System; class Geeks { // Main Method public static void Main() { // Taking NaN Console.WriteLine(MathF.Exp(Single.NaN)); // Taking PositiveInfinity Console.WriteLine(MathF.Exp(Single.PositiveInfinity)); // Taking NegativeInfinity Console.WriteLine(MathF.Exp(Single.NegativeInfinity)); } } Output: NaN Infinity 0 Comment More infoAdvertise with us Next Article MathF.Cbrt() Method in C# with Examples K Kirti_Mangal Follow Improve Article Tags : C# CSharp-method CSharp-MathF-Class Similar Reads MathF.Pow() Method in C# with Examples In C#, MathF.Pow(Single, Single) is a MathF class method. This method is used to calculate a number raise to the power of some other number. Syntax: public static float Pow (float x, float y); Parameters: x: It is a single-precision floating-point number which is to be raised to a power and type of 2 min read MathF.Log() Method in C# with Examples In C#, MathF.Log() is a MathF class method. It is used to return the logarithm of a specified number. This method can be overloaded by changing the number of the arguments passed. There are total 2 methods in the overload list of the MathF.Log() method as follows: MathF.Log(Single) Method MathF.Log( 4 min read MathF.Floor() Method in C# with Examples In C#, MathF.Floor(Single) is a MathF class method. This method is used to find the largest integer , which is less than or equal to the specified float value in the argument list. Syntax: public static float Floor (float x); Here, x is the float(Single) value whose floor value has to be calculated. 2 min read MathF.Sqrt() Method in C# with Examples In C#, MathF.Sqrt(Single) is a MathF class(present in system namespace) method which is used to calculate the square root of the specified Single or float data type value. Syntax: public static float Sqrt (float x); Here, x is the number whose square root is to be calculated and type of this paramet 2 min read MathF.Cbrt() Method in C# with Examples MathF.Cbrt(Single) Method is used to return the cube root of a floating point value. Syntax: public static float Cbrt (float x); Here, it takes a standard floating point number. Return Value: This method returns the cube root of the given value. Example 1: csharp // C# program to demonstrate the // 2 min read MathF.Log10() Method in C# with Examples In C#, MathF.Log10(Single) is a MathF class method. It is used to return the base 10 logarithm of a specified number. Syntax: public static float Log10 (float x); Here, x is the specified number whose logarithm to be calculated and its type is System.Single. Return Value: It returns the logarithm of 2 min read Like