MathF.Min() Method in C# with Examples
Last Updated :
04 Apr, 2019
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:
using System;
class GFG {
static void Main()
{
float f1 = 56.48f, f2 = 78.123457f;
float f3 = -785.2f, f4 = -58.2547f;
Console.WriteLine(MathF.Min(f1, f2));
Console.WriteLine(MathF.Min(f3, f4));
}
}
|
Share your thoughts in the comments
Please Login to comment...