1234567891011121314151617181920 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace bbiwarg.Utility
- {
- public static class HelperFunctions
- {
- public static T thresholdRange<T>(T min, T max, T value)
- {
- if (Comparer<T>.Default.Compare(min, value) > 0)
- return min;
- if (Comparer<T>.Default.Compare(value, max) > 0)
- return max;
- return value;
- }
- }
- }
|