MathF.Min() Method in C# with Examples
In C#, Min(Single, Single) is a MathF class method which is used to returns the minimum of the two specified numbers.
Syntax: public static float Min (float x, float y);
Here, x and y are the two floating point numbers which are compared.
Return Type: This method returns the minimum of the two numbers which specified into the parameter list and return type depends on the type of arguments passed.
Example:
// C# program to demonstrate the // MathF.Min(Single, Single) method using System; class GFG { // Main Method static void Main() { // taking different float values float f1 = 56.48f, f2 = 78.123457f; float f3 = -785.2f, f4 = -58.2547f; // displaying result Console.WriteLine(MathF.Min(f1, f2)); Console.WriteLine(MathF.Min(f3, f4)); } } |
56.48 -785.2
Recommended Posts:
- MathF.Pow() Method in C# with Examples
- MathF.Max() Method in C# with Examples
- MathF.Cos() Method in C# with Examples
- MathF.Log() Method in C# with Examples
- MathF.Tan() Method in C# with Examples
- MathF.Exp() Method in C# with Examples
- MathF.Sin() Method in C# with Examples
- MathF.Abs() Method in C# with Examples
- MathF.Atan() Method in C# with Examples
- MathF.Cbrt() Method in C# with Examples
- Double.CompareTo Method in C# with Examples
- C# | Char.GetTypeCode() Method with Examples
- C# | Char.GetHashCode() Method with Examples
- MathF.Sqrt() Method in C# with Examples
- MathF.Ceiling() Method in C# with Examples
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.



