Source/BooleanByte.cs
/// <summary>
/// Gets the bit at the specified index
/// </summary>
/// <param name="index">The bit of the byte to return (0-7)</param>
/// <returns>The boolean value of the bit</returns>
Gets the bit at the specified index
Gets the bit at the specified index
public bool GetBit(int index)
        {
            if (index >= 8 && index < 0)
                throw new ArgumentOutOfRangeException("Index must refer to a bit, 0-7.");
            return ((data & (1 << index)) != 0);
        }
public bool GetBit ( int index ) { if ( index >= 8 && index < 0 ) throw new ArgumentOutOfRangeException ( " " ) ; return ( ( data & ( 1 << index ) ) != 0 ) ; }
Gets the bit at the specified index
Gets the bit at the specified index
//Validation //Left-shift 1, then bitwise AND, then check for non-zero
The boolean value of the bit
The boolean value of the bit
index
int
The bit of the byte to return (0-7)
The bit of the byte to return ( 0 - 7 )