Class SetBitExtension
- Namespace
- Loehnert.Utility.Extensions
- Assembly
- Loehnert.Utility.dll
Extensions for setting an bit.
public static class SetBitExtension
- Inheritance
-
SetBitExtension
- Inherited Members
Methods
SetBit(byte, int)
Sets the bit at the position
.
public static byte SetBit(this byte value, int position)
Parameters
Returns
- byte
The value with the bit set.
Exceptions
- ArgumentOutOfRangeException
Thrown when
position
is not between 0 and 7.
SetBit(ushort, int)
Sets the bit at the position
.
public static ushort SetBit(this ushort value, int position)
Parameters
Returns
- ushort
The value with the bit set.
Exceptions
- ArgumentOutOfRangeException
Thrown when
position
is not between 0 and 15.
SetBit(uint, int)
Sets the bit at the position
.
public static uint SetBit(this uint value, int position)
Parameters
Returns
- uint
The value with the bit set.
Exceptions
- ArgumentOutOfRangeException
Thrown when
position
is not between 0 and 31.