# reversebits

> Returns the result of performing a reversal of the bit pattern of an int value.

## Definition

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

## reversebits(int)

Returns the result of performing a reversal of the bit pattern of an int value.

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

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Value to reverse.

### Returns

| Type                                                       | Description               |
| ---------------------------------------------------------- | ------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Value with reversed bits. |

## reversebits(int2)

Returns the result of performing a componentwise reversal of the bit pattern of an int2 vector.

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

### Parameters

**** (\[int2]\(/engine/6000.5/script-reference/unity/mathematics/int2)): Value to reverse.

### Returns

| Type                                                              | Description                             |
| ----------------------------------------------------------------- | --------------------------------------- |
| [int2](/engine/6000.5/script-reference/unity/mathematics/int2.md) | Value with componentwise reversed bits. |

## reversebits(int3)

Returns the result of performing a componentwise reversal of the bit pattern of an int3 vector.

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

### Parameters

**** (\[int3]\(/engine/6000.5/script-reference/unity/mathematics/int3)): Value to reverse.

### Returns

| Type                                                              | Description                             |
| ----------------------------------------------------------------- | --------------------------------------- |
| [int3](/engine/6000.5/script-reference/unity/mathematics/int3.md) | Value with componentwise reversed bits. |

## reversebits(int4)

Returns the result of performing a componentwise reversal of the bit pattern of an int4 vector.

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

### Parameters

**** (\[int4]\(/engine/6000.5/script-reference/unity/mathematics/int4)): Value to reverse.

### Returns

| Type                                                              | Description                             |
| ----------------------------------------------------------------- | --------------------------------------- |
| [int4](/engine/6000.5/script-reference/unity/mathematics/int4.md) | Value with componentwise reversed bits. |

## reversebits(uint)

Returns the result of performing a reversal of the bit pattern of a uint value.

```csharp
public static uint reversebits(uint x)
```

### Parameters

**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): Value to reverse.

### Returns

| Type                                                         | Description               |
| ------------------------------------------------------------ | ------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | Value with reversed bits. |

## reversebits(uint2)

Returns the result of performing a componentwise reversal of the bit pattern of an uint2 vector.

```csharp
public static uint2 reversebits(uint2 x)
```

### Parameters

**** (\[uint2]\(/engine/6000.5/script-reference/unity/mathematics/uint2)): Value to reverse.

### Returns

| Type                                                                | Description                             |
| ------------------------------------------------------------------- | --------------------------------------- |
| [uint2](/engine/6000.5/script-reference/unity/mathematics/uint2.md) | Value with componentwise reversed bits. |

## reversebits(uint3)

Returns the result of performing a componentwise reversal of the bit pattern of an uint3 vector.

```csharp
public static uint3 reversebits(uint3 x)
```

### Parameters

**** (\[uint3]\(/engine/6000.5/script-reference/unity/mathematics/uint3)): Value to reverse.

### Returns

| Type                                                                | Description                             |
| ------------------------------------------------------------------- | --------------------------------------- |
| [uint3](/engine/6000.5/script-reference/unity/mathematics/uint3.md) | Value with componentwise reversed bits. |

## reversebits(uint4)

Returns the result of performing a componentwise reversal of the bit pattern of an uint4 vector.

```csharp
public static uint4 reversebits(uint4 x)
```

### Parameters

**** (\[uint4]\(/engine/6000.5/script-reference/unity/mathematics/uint4)): Value to reverse.

### Returns

| Type                                                                | Description                             |
| ------------------------------------------------------------------- | --------------------------------------- |
| [uint4](/engine/6000.5/script-reference/unity/mathematics/uint4.md) | Value with componentwise reversed bits. |

## reversebits(long)

Returns the result of performing a reversal of the bit pattern of a long value.

```csharp
public static long reversebits(long x)
```

### Parameters

**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): Value to reverse.

### Returns

| Type                                                        | Description               |
| ----------------------------------------------------------- | ------------------------- |
| [long](https://learn.microsoft.com/dotnet/api/system.int64) | Value with reversed bits. |

## reversebits(ulong)

Returns the result of performing a reversal of the bit pattern of a ulong value.

```csharp
public static ulong reversebits(ulong x)
```

### Parameters

**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): Value to reverse.

### Returns

| Type                                                          | Description               |
| ------------------------------------------------------------- | ------------------------- |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | Value with reversed bits. |
