Files
MeadeGeneric/Meade.net.Telescope/DoubleExtensions.cs
T
2019-10-01 20:57:49 +01:00

27 lines
685 B
C#

namespace ASCOM.Meade.net
{
public static class DoubleExtensions
{
public static bool InRange(this double value, double low, double high)
{
if (value < low)
return false;
if (value > high)
return false;
return true;
}
public static ComparisonResult Compare(this double value, double comparison)
{
var result = value.CompareTo(comparison);
if (result < 0)
return ComparisonResult.Lower;
if (result == 0)
return ComparisonResult.Equals;
return ComparisonResult.Greater;
}
}
}