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 this parameter is System.Single.
y: It is a single-precision floating-point number which specifies a power or exponent and type of this parameter is System.Single.
Return Type: The function returns the number base raised to the power. The return type of this method is System.Single
Example:
// C# program to illustrate the // MathF.Pow(Single, Single) Method using System; class GFG { // Main Method static public void Main() { // Find power using MathF.Pow // 8 is base and 4 is power or // index or exponent of a number float pow_ab = MathF.Pow(8f, 4f); // Print the result Console.WriteLine(pow_ab); // 7.5 is base and 2 is power or // index or exponent of a number float pow_tt = MathF.Pow(7.5f, 2f); // Print the result Console.WriteLine(pow_tt); // 1234 is base and 7 is power or // index or exponent of a number float pow_t = MathF.Pow(1234f, 7f); // Print the result Console.WriteLine(pow_t); } } |
4096 56.25 4.357186E+21
Recommended Posts:
- MathF.Tan() Method in C# with Examples
- MathF.Max() Method in C# with Examples
- MathF.Min() Method in C# with Examples
- MathF.Abs() Method in C# with Examples
- MathF.Exp() Method in C# with Examples
- MathF.Log() Method in C# with Examples
- MathF.Sin() Method in C# with Examples
- MathF.Cos() Method in C# with Examples
- Single.GetTypeCode Method in C# with Examples
- UInt32.ToString Method in C# with Examples | Set - 2
- Single.Equals() Method in C# with Examples
- UInt64.ToString() Method in C# with Examples | Set - 1
- Single.GetHashCode() Method in C# with Examples
- UInt32.ToString() Method in C# with Examples | Set - 1
- UInt16.ToString() Method in C# with Examples | Set - 1
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



