Edytuj

Udostępnij za pośrednictwem


BitHelper.HasByteEqualTo Method

Definition

Overloads

HasByteEqualTo(UInt32, Byte)

Checks whether a byte in the input UInt32 value matches a target value.

HasByteEqualTo(UInt64, Byte)

Checks whether a byte in the input UInt32 value matches a target value. This method mirrors HasByteEqualTo(UInt32, Byte), but with UInt64 values.

HasByteEqualTo(UInt32, Byte)

Checks whether a byte in the input UInt32 value matches a target value.

public static bool HasByteEqualTo (uint value, byte target);
static member HasByteEqualTo : uint32 * byte -> bool
Public Shared Function HasByteEqualTo (value As UInteger, target As Byte) As Boolean

Parameters

value
UInt32

The input value to check.

target
Byte

The target byte to look for.

Returns

Whether value has any bytes set to target.

Remarks

This method contains no branches. For more info, see https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord.

Applies to

HasByteEqualTo(UInt64, Byte)

Checks whether a byte in the input UInt32 value matches a target value. This method mirrors HasByteEqualTo(UInt32, Byte), but with UInt64 values.

public static bool HasByteEqualTo (ulong value, byte target);
static member HasByteEqualTo : uint64 * byte -> bool
Public Shared Function HasByteEqualTo (value As ULong, target As Byte) As Boolean

Parameters

value
UInt64

The input value to check.

target
Byte

The target byte to look for.

Returns

Whether value has any bytes set to target.

Applies to