메소드 | 설명 | |
---|---|---|
CountBitsCleared ( uint value ) : int |
Counts the number of bits that are not set
|
|
CountBitsCleared ( ulong value ) : int |
Counts the number of bits that are not set
|
|
CountBitsSet ( uint value ) : int |
Counts the number of bits that are set
|
|
CountBitsSet ( ulong value ) : int |
Counts the number of bits that are set
|
|
CountLeadingOnes ( uint value ) : int |
Counts the number of consecutive 1's starting from the highest bit working down.
|
|
CountLeadingOnes ( ulong value ) : int |
Counts the number of consecutive 1's starting from the highest bit working down.
|
|
CountLeadingZeros ( uint value ) : int |
Counts the number of consecutive 0's starting from the highest bit working down. Unfortunately, c# cannot call the cpu instruction clz Example from http://en.wikipedia.org/wiki/Find_first_set |
|
CountLeadingZeros ( ulong value ) : int |
Counts the number of consecutive 0's starting from the highest bit working down. Unfortunately, c# cannot call the cpu instruction clz Example from http://en.wikipedia.org/wiki/Find_first_set |
|
CountTrailingOnes ( uint value ) : int |
Counts the number of consecutive 1's starting from the lowest bit working up.
|
|
CountTrailingOnes ( ulong value ) : int |
Counts the number of consecutive 1's starting from the lowest bit working up.
|
|
CountTrailingZeros ( uint value ) : int |
Counts the number of consecutive 0's starting from the lowest bit working up. Unfortunately, c# cannot call the cpu instruction ctz Example from http://en.wikipedia.org/wiki/Find_first_set |
|
CountTrailingZeros ( ulong value ) : int |
Counts the number of consecutive 0's starting from the lowest bit working up. Unfortunately, c# cannot call the cpu instruction ctz Example from http://en.wikipedia.org/wiki/Find_first_set |
|
CreateBitMask ( int bitCount ) : ulong |
Creates a bit mask for a number with the given number of bits.
|
|
GetClearedBitPositions ( uint value ) : IEnumerable |
Returns the bit position for every bit that is cleared in the provided value. Bit positions are defined as 0-31;
|
|
GetClearedBitPositions ( ulong value ) : IEnumerable |
Returns the bit position for every bit that is cleared in the provided value. Bit positions are defined as 0-63;
|
|
GetSetBitPositions ( uint value ) : IEnumerable |
Returns the bit position for every bit that is set in the provided value. Bit positions are defined as 0-31;
|
|
GetSetBitPositions ( ulong value ) : IEnumerable |
Returns the bit position for every bit that is set in the provided value. Bit positions are defined as 0-63;
|
|
IsPowerOfTwo ( int value ) : bool |
Determines if the number is a power of 2.
|
|
IsPowerOfTwo ( long value ) : bool |
Determines if the number is a power of 2.
|
|
IsPowerOfTwo ( uint value ) : bool |
Determines if the number is a power of 2.
|
|
IsPowerOfTwo ( ulong value ) : bool |
Determines if the number is a power of 2.
|
|
RoundDownToNearestPowerOfTwo ( uint value ) : uint |
Rounds a number down to the nearest power of 2. If the value is a power of two, the same value is returned. If value is zero, 1 is returned.
|
|
RoundDownToNearestPowerOfTwo ( ulong value ) : ulong |
Rounds a number down to the nearest power of 2. If the value is a power of two, the same value is returned. If value is zero, one is returned.
|
|
RoundUpToNearestPowerOfTwo ( uint value ) : uint |
Rounds a number up to the nearest power of 2. If the value is a power of two, the same value is returned. If the value is larger than the largest power of 2. It is rounded down. Method based on a method found at: http://graphics.stanford.edu/~seander/bithacks.htm Subtitle: Round up to the next highest power of 2 |
|
RoundUpToNearestPowerOfTwo ( ulong value ) : ulong |
Rounds a number up to the nearest power of 2. If the value is a power of two, the same value is returned. If the value is larger than the largest power of 2. It is rounded down. Method based on a method found at: http://graphics.stanford.edu/~seander/bithacks.htm Subtitle: Round up to the next highest power of 2 |
public static CountBitsCleared ( ulong value ) : int | ||
value | ulong | |
리턴 | int |
public static CountLeadingOnes ( ulong value ) : int | ||
value | ulong | |
리턴 | int |
public static CountLeadingZeros ( uint value ) : int | ||
value | uint | |
리턴 | int |
public static CountLeadingZeros ( ulong value ) : int | ||
value | ulong | |
리턴 | int |
public static CountTrailingOnes ( uint value ) : int | ||
value | uint | |
리턴 | int |
public static CountTrailingOnes ( ulong value ) : int | ||
value | ulong | |
리턴 | int |
public static CountTrailingZeros ( uint value ) : int | ||
value | uint | |
리턴 | int |
public static CountTrailingZeros ( ulong value ) : int | ||
value | ulong | |
리턴 | int |
public static CreateBitMask ( int bitCount ) : ulong | ||
bitCount | int | |
리턴 | ulong |
public static GetClearedBitPositions ( uint value ) : IEnumerable |
||
value | uint | |
리턴 | IEnumerable |
public static GetClearedBitPositions ( ulong value ) : IEnumerable |
||
value | ulong | |
리턴 | IEnumerable |
public static GetSetBitPositions ( uint value ) : IEnumerable |
||
value | uint | |
리턴 | IEnumerable |
public static GetSetBitPositions ( ulong value ) : IEnumerable |
||
value | ulong | |
리턴 | IEnumerable |
public static IsPowerOfTwo ( int value ) : bool | ||
value | int | The value to check power of two properties |
리턴 | bool |
public static IsPowerOfTwo ( long value ) : bool | ||
value | long | The value to check power of two properties |
리턴 | bool |
public static IsPowerOfTwo ( uint value ) : bool | ||
value | uint | The value to check power of two properties |
리턴 | bool |
public static IsPowerOfTwo ( ulong value ) : bool | ||
value | ulong | The value to check power of two properties |
리턴 | bool |
public static RoundDownToNearestPowerOfTwo ( uint value ) : uint | ||
value | uint | |
리턴 | uint |
public static RoundDownToNearestPowerOfTwo ( ulong value ) : ulong | ||
value | ulong | |
리턴 | ulong |
public static RoundUpToNearestPowerOfTwo ( uint value ) : uint | ||
value | uint | |
리턴 | uint |
public static RoundUpToNearestPowerOfTwo ( ulong value ) : ulong | ||
value | ulong | |
리턴 | ulong |