C# 클래스 System.Xml.Bits

Contains static utility methods used to manipulate bits in a word.
파일 보기 프로젝트 열기: gbarnett/shared-source-cli-2.0 1 사용 예제들

공개 메소드들

메소드 설명
ClearLeast ( uint num ) : uint

Clear the least significant bit that is set and return the result.

Count ( uint num ) : int

Returns the number of 1 bits in an unsigned integer. Counts bits by divide-and-conquer method, first computing 16 2-bit counts, then 8 4-bit counts, then 4 8-bit counts, then 2 16-bit counts, and finally 1 32-bit count.

ExactlyOne ( uint num ) : bool

Returns true if the unsigned integer has exactly one bit set.

LeastPosition ( uint num ) : int

Compute the 1-based position of the least sigificant bit that is set, and return it (return 0 if no bits are set). (e.g. 0x1001100 will return 3, since the 3rd bit is set).

MoreThanOne ( uint num ) : bool

Returns true if the unsigned integer has more than one bit set.

메소드 상세

ClearLeast() 공개 정적인 메소드

Clear the least significant bit that is set and return the result.
public static ClearLeast ( uint num ) : uint
num uint
리턴 uint

Count() 공개 정적인 메소드

Returns the number of 1 bits in an unsigned integer. Counts bits by divide-and-conquer method, first computing 16 2-bit counts, then 8 4-bit counts, then 4 8-bit counts, then 2 16-bit counts, and finally 1 32-bit count.
public static Count ( uint num ) : int
num uint
리턴 int

ExactlyOne() 공개 정적인 메소드

Returns true if the unsigned integer has exactly one bit set.
public static ExactlyOne ( uint num ) : bool
num uint
리턴 bool

LeastPosition() 공개 정적인 메소드

Compute the 1-based position of the least sigificant bit that is set, and return it (return 0 if no bits are set). (e.g. 0x1001100 will return 3, since the 3rd bit is set).
public static LeastPosition ( uint num ) : int
num uint
리턴 int

MoreThanOne() 공개 정적인 메소드

Returns true if the unsigned integer has more than one bit set.
public static MoreThanOne ( uint num ) : bool
num uint
리턴 bool