BitOperations.TrailingZeroCount 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
TrailingZeroCount(UInt64) 
Count the number of trailing zero bits in an unsigned 64bit integer value mask. 
TrailingZeroCount(Int32) 
Counts the number of trailing zero bits in an 32bit integer value mask. 
TrailingZeroCount(Int64) 
Counts the number of trailing zero bits in a 64bit integer value mask. 
TrailingZeroCount(IntPtr) 
Counts the number of trailing zero bits in a mask. Similar in behavior to the x86 instruction TZCNT. 
TrailingZeroCount(UInt32) 
Counts the number of trailing zero bits in an unsigned 32bit integer value mask. 
TrailingZeroCount(UIntPtr) 
Counts the number of trailing zero bits in a mask. Similar in behavior to the x86 instruction TZCNT. 
TrailingZeroCount(UInt64)
Important
This API is not CLScompliant.
Count the number of trailing zero bits in an unsigned 64bit integer value mask.
public:
static int TrailingZeroCount(System::UInt64 value);
[System.CLSCompliant(false)]
public static int TrailingZeroCount (ulong value);
[<System.CLSCompliant(false)>]
static member TrailingZeroCount : uint64 > int
Public Shared Function TrailingZeroCount (value As ULong) As Integer
Parameters
 value
 UInt64
The mask.
Returns
The number of trailing zero bits in the mask.
 Attributes
Remarks
This method is similar in behavior to the x86 instruction TZCNT.
Applies to
TrailingZeroCount(Int32)
Counts the number of trailing zero bits in an 32bit integer value mask.
public:
static int TrailingZeroCount(int value);
public static int TrailingZeroCount (int value);
static member TrailingZeroCount : int > int
Public Shared Function TrailingZeroCount (value As Integer) As Integer
Parameters
 value
 Int32
The mask.
Returns
The number of trailing zero bits in the integer value.
Remarks
This method is similar in behavior to the x86 instruction TZCNT.
Applies to
TrailingZeroCount(Int64)
Counts the number of trailing zero bits in a 64bit integer value mask.
public:
static int TrailingZeroCount(long value);
public static int TrailingZeroCount (long value);
static member TrailingZeroCount : int64 > int
Public Shared Function TrailingZeroCount (value As Long) As Integer
Parameters
 value
 Int64
The mask.
Returns
The number of trailing zero bits in the mask.
Remarks
This method is similar in behavior to the x86 instruction TZCNT.
Applies to
TrailingZeroCount(IntPtr)
Counts the number of trailing zero bits in a mask. Similar in behavior to the x86 instruction TZCNT.
public:
static int TrailingZeroCount(IntPtr value);
public static int TrailingZeroCount (IntPtr value);
static member TrailingZeroCount : nativeint > int
Public Shared Function TrailingZeroCount (value As IntPtr) As Integer
Parameters
 value

IntPtr
nativeint
The value.
Returns
The count of trailing zero bits in a mask.
Applies to
TrailingZeroCount(UInt32)
Important
This API is not CLScompliant.
Counts the number of trailing zero bits in an unsigned 32bit integer value mask.
public:
static int TrailingZeroCount(System::UInt32 value);
[System.CLSCompliant(false)]
public static int TrailingZeroCount (uint value);
[<System.CLSCompliant(false)>]
static member TrailingZeroCount : uint32 > int
Public Shared Function TrailingZeroCount (value As UInteger) As Integer
Parameters
 value
 UInt32
The mask.
Returns
The number of trailing zero bits in the mask.
 Attributes
Remarks
This method is similar in behavior to the x86 instruction TZCNT.
Applies to
TrailingZeroCount(UIntPtr)
Important
This API is not CLScompliant.
Counts the number of trailing zero bits in a mask. Similar in behavior to the x86 instruction TZCNT.
public:
static int TrailingZeroCount(UIntPtr value);
[System.CLSCompliant(false)]
public static int TrailingZeroCount (UIntPtr value);
[<System.CLSCompliant(false)>]
static member TrailingZeroCount : unativeint > int
Public Shared Function TrailingZeroCount (value As UIntPtr) As Integer
Parameters
 value

UIntPtr
unativeint
The value.
Returns
The count of trailing zero bits in a mask.
 Attributes
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for