예제 #1
0
파일: Bits.SByte.cs 프로젝트: madelson/Bits
        /// <summary>
        /// Determines whether the <paramref name="index"/>th bit is set in <paramref name="value"/>
        /// </summary>
        public static bool GetBit(this sbyte value, int index)
        {
            if ((index & ~(SizeOfSByteInBits - 1)) != 0)
            {
                ThrowIndexOutOfRange();
            }

            return(value.HasAnyFlag((sbyte)(((sbyte)1) << index)));
        }