BitHelper.HasZeroByte Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasZeroByte(UInt64) |
Checks whether the given value has any bytes that are set to 0. This method mirrors HasZeroByte(UInt32), but with UInt64 values. |
HasZeroByte(UInt32) |
Checks whether the given value has any bytes that are set to 0. That is, given a UInt32 value, which has a total of 4 bytes, it checks whether any of those have all the bits set to 0. |
HasZeroByte(UInt64)
Checks whether the given value has any bytes that are set to 0. This method mirrors HasZeroByte(UInt32), but with UInt64 values.
public static bool HasZeroByte (ulong value);
static member HasZeroByte : uint64 -> bool
Public Shared Function HasZeroByte (value As ULong) As Boolean
Parameters
- value
- UInt64
The input value to check.
Returns
Whether value
has any bytes set to 0.
Applies to
HasZeroByte(UInt32)
Checks whether the given value has any bytes that are set to 0. That is, given a UInt32 value, which has a total of 4 bytes, it checks whether any of those have all the bits set to 0.
public static bool HasZeroByte (uint value);
static member HasZeroByte : uint32 -> bool
Public Shared Function HasZeroByte (value As UInteger) As Boolean
Parameters
- value
- UInt32
The input value to check.
Returns
Whether value
has any bytes set to 0.
Remarks
This method contains no branches. For more background on this subject, see https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord.