DoubleExtension.InRange C# (CSharp) Method

InRange() public static method

A T extension method that check if the value is between inclusively the minValue and maxValue.
public static InRange ( double @this, double minValue, double maxValue ) : bool
@this double
minValue double The minimum value.
maxValue double The maximum value.
return bool
    public static bool InRange(this double @this, double minValue, double maxValue) => @this.CompareTo(minValue) >= 0 && @this.CompareTo(maxValue) <= 0;