# ceilpow2

> Returns the smallest power of two greater than or equal to the input.

## Definition

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

## ceilpow2(int)

Returns the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Input value.

### Returns

| Type                                                       | Description                                                   |
| ---------------------------------------------------------- | ------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(int2)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[int2]\(/engine/6000.7/script-reference/unity/mathematics/int2)): Input value.

### Returns

| Type                                                              | Description                                                                 |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [int2](/engine/6000.7/script-reference/unity/mathematics/int2.md) | The componentwise smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(int3)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[int3]\(/engine/6000.7/script-reference/unity/mathematics/int3)): Input value.

### Returns

| Type                                                              | Description                                                                 |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [int3](/engine/6000.7/script-reference/unity/mathematics/int3.md) | The componentwise smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(int4)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[int4]\(/engine/6000.7/script-reference/unity/mathematics/int4)): Input value.

### Returns

| Type                                                              | Description                                                                 |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [int4](/engine/6000.7/script-reference/unity/mathematics/int4.md) | The componentwise smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(uint)

Returns the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): Input value.

### Returns

| Type                                                         | Description                                                   |
| ------------------------------------------------------------ | ------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(uint2)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[uint2]\(/engine/6000.7/script-reference/unity/mathematics/uint2)): Input value.

### Returns

| Type                                                                | Description                                                                 |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [uint2](/engine/6000.7/script-reference/unity/mathematics/uint2.md) | The componentwise smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(uint3)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[uint3]\(/engine/6000.7/script-reference/unity/mathematics/uint3)): Input value.

### Returns

| Type                                                                | Description                                                                 |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [uint3](/engine/6000.7/script-reference/unity/mathematics/uint3.md) | The componentwise smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(uint4)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[uint4]\(/engine/6000.7/script-reference/unity/mathematics/uint4)): Input value.

### Returns

| Type                                                                | Description                                                                 |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [uint4](/engine/6000.7/script-reference/unity/mathematics/uint4.md) | The componentwise smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(long)

Returns the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): Input value.

### Returns

| Type                                                        | Description                                                   |
| ----------------------------------------------------------- | ------------------------------------------------------------- |
| [long](https://learn.microsoft.com/dotnet/api/system.int64) | The smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.

## ceilpow2(ulong)

Returns the smallest power of two greater than or equal to the input.

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

### Parameters

**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): Input value.

### Returns

| Type                                                          | Description                                                   |
| ------------------------------------------------------------- | ------------------------------------------------------------- |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | The smallest power of two greater than or equal to the input. |

### Remarks

Also known as nextpow2.
