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
num
sbyteNumber to test.
min
sbyteLower bound of the range.
max
sbyteUpper bound of the range.
inclusive
boolWhether 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
num
byteNumber to test.
min
byteLower bound of the range.
max
byteUpper bound of the range.
inclusive
boolWhether 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
num
shortNumber to test.
min
shortLower bound of the range.
max
shortUpper bound of the range.
inclusive
boolWhether 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
num
ushortNumber to test.
min
ushortLower bound of the range.
max
ushortUpper bound of the range.
inclusive
boolWhether 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
num
intNumber to test.
min
intLower bound of the range.
max
intUpper bound of the range.
inclusive
boolWhether 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
num
uintNumber to test.
min
uintLower bound of the range.
max
uintUpper bound of the range.
inclusive
boolWhether 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
num
longNumber to test.
min
longLower bound of the range.
max
longUpper bound of the range.
inclusive
boolWhether 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
num
ulongNumber to test.
min
ulongLower bound of the range.
max
ulongUpper bound of the range.
inclusive
boolWhether 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
num
floatNumber to test.
min
floatLower bound of the range.
max
floatUpper bound of the range.
inclusive
boolWhether 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
num
doubleNumber to test.
min
doubleLower bound of the range.
max
doubleUpper bound of the range.
inclusive
boolWhether the check is to be inclusive.
Returns
- bool
Whether the value is in range.