# tzcnt

> Computes the trailing zero count in the binary representation of the input value.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Mathematics](/engine/6000.6/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

## tzcnt(int)

Computes the trailing zero count in the binary representation of the input value.

```csharp
public static int tzcnt(int x)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Input to use when computing the trailing zero count.

### Returns

| Type                                                       | Description                                   |
| ---------------------------------------------------------- | --------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns the trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(int2)

Computes the component-wise trailing zero count in the binary representation of the input value.

```csharp
public static int2 tzcnt(int2 x)
```

### Parameters

**** (\[int2]\(/engine/6000.6/script-reference/unity/mathematics/int2)): Input to use when computing the trailing zero count.

### Returns

| Type                                                              | Description                                                  |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| [int2](/engine/6000.6/script-reference/unity/mathematics/int2.md) | Returns the component-wise trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(int3)

Computes the component-wise trailing zero count in the binary representation of the input value.

```csharp
public static int3 tzcnt(int3 x)
```

### Parameters

**** (\[int3]\(/engine/6000.6/script-reference/unity/mathematics/int3)): Input to use when computing the trailing zero count.

### Returns

| Type                                                              | Description                                                  |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| [int3](/engine/6000.6/script-reference/unity/mathematics/int3.md) | Returns the component-wise trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(int4)

Computes the component-wise trailing zero count in the binary representation of the input value.

```csharp
public static int4 tzcnt(int4 x)
```

### Parameters

**** (\[int4]\(/engine/6000.6/script-reference/unity/mathematics/int4)): Input to use when computing the trailing zero count.

### Returns

| Type                                                              | Description                                                  |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| [int4](/engine/6000.6/script-reference/unity/mathematics/int4.md) | Returns the component-wise trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(uint)

Computes the trailing zero count in the binary representation of the input value.

```csharp
public static int tzcnt(uint x)
```

### Parameters

**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): Input to use when computing the trailing zero count.

### Returns

| Type                                                       | Description                                   |
| ---------------------------------------------------------- | --------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns the trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(uint2)

Computes the component-wise trailing zero count in the binary representation of the input value.

```csharp
public static int2 tzcnt(uint2 x)
```

### Parameters

**** (\[uint2]\(/engine/6000.6/script-reference/unity/mathematics/uint2)): Input to use when computing the trailing zero count.

### Returns

| Type                                                              | Description                                                  |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| [int2](/engine/6000.6/script-reference/unity/mathematics/int2.md) | Returns the component-wise trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(uint3)

Computes the component-wise trailing zero count in the binary representation of the input value.

```csharp
public static int3 tzcnt(uint3 x)
```

### Parameters

**** (\[uint3]\(/engine/6000.6/script-reference/unity/mathematics/uint3)): Input to use when computing the trailing zero count.

### Returns

| Type                                                              | Description                                                  |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| [int3](/engine/6000.6/script-reference/unity/mathematics/int3.md) | Returns the component-wise trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(uint4)

Computes the component-wise trailing zero count in the binary representation of the input value.

```csharp
public static int4 tzcnt(uint4 x)
```

### Parameters

**** (\[uint4]\(/engine/6000.6/script-reference/unity/mathematics/uint4)): Input to use when computing the trailing zero count.

### Returns

| Type                                                              | Description                                                  |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| [int4](/engine/6000.6/script-reference/unity/mathematics/int4.md) | Returns the component-wise trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(long)

Computes the trailing zero count in the binary representation of the input value.

```csharp
public static int tzcnt(long x)
```

### Parameters

**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): Input to use when computing the trailing zero count.

### Returns

| Type                                                       | Description                                   |
| ---------------------------------------------------------- | --------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns the trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.

## tzcnt(ulong)

Computes the trailing zero count in the binary representation of the input value.

```csharp
public static int tzcnt(ulong x)
```

### Parameters

**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): Input to use when computing the trailing zero count.

### Returns

| Type                                                       | Description                                   |
| ---------------------------------------------------------- | --------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns the trailing zero count of the input. |

### Remarks

Assuming that the least significant bit is on the right, the integer value 4 has a binary representation 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the trailing zero count is zero.
