Class IsBitSetExtension
- Namespace
- Loehnert.Utility.Extensions
- Assembly
- Loehnert.Utility.dll
Extensions for getting the state of an bit.
public static class IsBitSetExtension
- Inheritance
-
IsBitSetExtension
- Inherited Members
Methods
IsBitSet(byte, int)
Gets a value indicating whether a bit is set.
public static bool IsBitSet(this byte value, int position)
Parameters
Returns
- bool
True if the bit is set. Otherwise false.
Exceptions
- ArgumentOutOfRangeException
Thrown when
position
is not between 0 and 7.
IsBitSet(ushort, int)
Gets a value indicating whether a bit is set.
public static bool IsBitSet(this ushort value, int position)
Parameters
Returns
- bool
True if the bit is set. Otherwise false.
Exceptions
- ArgumentOutOfRangeException
Thrown when
position
is not between 0 and 15.
IsBitSet(uint, int)
Gets a value indicating whether a bit is set.
public static bool IsBitSet(this uint value, int position)
Parameters
Returns
- bool
True if the bit is set. Otherwise false.
Exceptions
- ArgumentOutOfRangeException
Thrown when
position
is not between 0 and 31.