995554a51f76413fee825aa7231b992768ad77d5
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / XamlBinding / Internals / NumericExtensions.cs
1 using System;
2 using System.ComponentModel;
3
4 namespace Tizen.NUI.Binding.Internals
5 {
6     internal static class NumericExtensions
7     {
8
9         public static double Clamp(this double self, double min, double max)
10         {
11             return Math.Min(max, Math.Max(self, min));
12         }
13
14         public static float Clamp(this float self, float min, float max)
15         {
16             return Math.Min(max, Math.Max(self, min));
17         }
18
19         public static int Clamp(this int self, int min, int max)
20         {
21             return Math.Min(max, Math.Max(self, min));
22         }
23     }
24 }