Table of Contents

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 sbyte

Number to test.

min sbyte

Lower bound of the range.

max sbyte

Upper bound of the range.

inclusive bool

Whether 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 byte

Number to test.

min byte

Lower bound of the range.

max byte

Upper bound of the range.

inclusive bool

Whether 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 short

Number to test.

min short

Lower bound of the range.

max short

Upper bound of the range.

inclusive bool

Whether 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 ushort

Number to test.

min ushort

Lower bound of the range.

max ushort

Upper bound of the range.

inclusive bool

Whether 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 int

Number to test.

min int

Lower bound of the range.

max int

Upper bound of the range.

inclusive bool

Whether 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 uint

Number to test.

min uint

Lower bound of the range.

max uint

Upper bound of the range.

inclusive bool

Whether 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 long

Number to test.

min long

Lower bound of the range.

max long

Upper bound of the range.

inclusive bool

Whether 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 ulong

Number to test.

min ulong

Lower bound of the range.

max ulong

Upper bound of the range.

inclusive bool

Whether 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 float

Number to test.

min float

Lower bound of the range.

max float

Upper bound of the range.

inclusive bool

Whether 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 double

Number to test.

min double

Lower bound of the range.

max double

Upper bound of the range.

inclusive bool

Whether the check is to be inclusive.

Returns

bool

Whether the value is in range.