maui-linux/Xamarin.Forms.Core/NumericExtensions.cs

17 строки
328 B
C#

using System;
namespace Xamarin.Forms
{
internal static class NumericExtensions
{
public static double Clamp(this double self, double min, double max)
{
return Math.Min(max, Math.Max(self, min));
}
public static int Clamp(this int self, int min, int max)
{
return Math.Min(max, Math.Max(self, min));
}
}
}