Method IsInRange
- Namespace
- DisCatSharp.Common
- Assembly
- DisCatSharp.Common.dll
IsInRange(sbyte, sbyte, sbyte, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this sbyte num, sbyte min, sbyte max, bool inclusive = true)
Parameters
numsbyteNumber to test.
minsbyteLower bound of the range.
maxsbyteUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(byte, byte, byte, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this byte num, byte min, byte max, bool inclusive = true)
Parameters
numbyteNumber to test.
minbyteLower bound of the range.
maxbyteUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(short, short, short, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this short num, short min, short max, bool inclusive = true)
Parameters
numshortNumber to test.
minshortLower bound of the range.
maxshortUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(ushort, ushort, ushort, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this ushort num, ushort min, ushort max, bool inclusive = true)
Parameters
numushortNumber to test.
minushortLower bound of the range.
maxushortUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(int, int, int, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this int num, int min, int max, bool inclusive = true)
Parameters
numintNumber to test.
minintLower bound of the range.
maxintUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(uint, uint, uint, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this uint num, uint min, uint max, bool inclusive = true)
Parameters
numuintNumber to test.
minuintLower bound of the range.
maxuintUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(long, long, long, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this long num, long min, long max, bool inclusive = true)
Parameters
numlongNumber to test.
minlongLower bound of the range.
maxlongUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(ulong, ulong, ulong, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this ulong num, ulong min, ulong max, bool inclusive = true)
Parameters
numulongNumber to test.
minulongLower bound of the range.
maxulongUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(float, float, float, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this float num, float min, float max, bool inclusive = true)
Parameters
numfloatNumber to test.
minfloatLower bound of the range.
maxfloatUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.
IsInRange(double, double, double, bool)
Tests whether given value is in supplied range, optionally allowing it to be an exclusive check.
public static bool IsInRange(this double num, double min, double max, bool inclusive = true)
Parameters
numdoubleNumber to test.
mindoubleLower bound of the range.
maxdoubleUpper bound of the range.
inclusiveboolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.