# ceillog2

> Computes the ceiling of the base-2 logarithm of x.

## Definition

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

## ceillog2(int)

Computes the ceiling of the base-2 logarithm of x.

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

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Integer to be used as input.

### Returns

| Type                                                       | Description                                          |
| ---------------------------------------------------------- | ---------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Ceiling of the base-2 logarithm of x, as an integer. |

### Remarks

x must be greater than 0, otherwise the result is undefined.

## ceillog2(int2)

Computes the componentwise ceiling of the base-2 logarithm of x.

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

### Parameters

**** (\[int2]\(/engine/6000.7/script-reference/unity/mathematics/int2)): int2 to be used as input.

### Returns

| Type                                                              | Description                                         |
| ----------------------------------------------------------------- | --------------------------------------------------- |
| [int2](/engine/6000.7/script-reference/unity/mathematics/int2.md) | Componentwise ceiling of the base-2 logarithm of x. |

### Remarks

Components of x must be greater than 0, otherwise the result for that component is undefined.

## ceillog2(int3)

Computes the componentwise ceiling of the base-2 logarithm of x.

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

### Parameters

**** (\[int3]\(/engine/6000.7/script-reference/unity/mathematics/int3)): int3 to be used as input.

### Returns

| Type                                                              | Description                                         |
| ----------------------------------------------------------------- | --------------------------------------------------- |
| [int3](/engine/6000.7/script-reference/unity/mathematics/int3.md) | Componentwise ceiling of the base-2 logarithm of x. |

### Remarks

Components of x must be greater than 0, otherwise the result for that component is undefined.

## ceillog2(int4)

Computes the componentwise ceiling of the base-2 logarithm of x.

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

### Parameters

**** (\[int4]\(/engine/6000.7/script-reference/unity/mathematics/int4)): int4 to be used as input.

### Returns

| Type                                                              | Description                                         |
| ----------------------------------------------------------------- | --------------------------------------------------- |
| [int4](/engine/6000.7/script-reference/unity/mathematics/int4.md) | Componentwise ceiling of the base-2 logarithm of x. |

### Remarks

Components of x must be greater than 0, otherwise the result for that component is undefined.

## ceillog2(uint)

Computes the ceiling of the base-2 logarithm of x.

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

### Parameters

**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): Unsigned integer to be used as input.

### Returns

| Type                                                       | Description                                          |
| ---------------------------------------------------------- | ---------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Ceiling of the base-2 logarithm of x, as an integer. |

### Remarks

x must be greater than 0, otherwise the result is undefined.

## ceillog2(uint2)

Computes the componentwise ceiling of the base-2 logarithm of x.

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

### Parameters

**** (\[uint2]\(/engine/6000.7/script-reference/unity/mathematics/uint2)): uint2 to be used as input.

### Returns

| Type                                                              | Description                                         |
| ----------------------------------------------------------------- | --------------------------------------------------- |
| [int2](/engine/6000.7/script-reference/unity/mathematics/int2.md) | Componentwise ceiling of the base-2 logarithm of x. |

### Remarks

Components of x must be greater than 0, otherwise the result for that component is undefined.

## ceillog2(uint3)

Computes the componentwise ceiling of the base-2 logarithm of x.

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

### Parameters

**** (\[uint3]\(/engine/6000.7/script-reference/unity/mathematics/uint3)): uint3 to be used as input.

### Returns

| Type                                                              | Description                                         |
| ----------------------------------------------------------------- | --------------------------------------------------- |
| [int3](/engine/6000.7/script-reference/unity/mathematics/int3.md) | Componentwise ceiling of the base-2 logarithm of x. |

### Remarks

Components of x must be greater than 0, otherwise the result for that component is undefined.

## ceillog2(uint4)

Computes the componentwise ceiling of the base-2 logarithm of x.

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

### Parameters

**** (\[uint4]\(/engine/6000.7/script-reference/unity/mathematics/uint4)): uint4 to be used as input.

### Returns

| Type                                                              | Description                                         |
| ----------------------------------------------------------------- | --------------------------------------------------- |
| [int4](/engine/6000.7/script-reference/unity/mathematics/int4.md) | Componentwise ceiling of the base-2 logarithm of x. |

### Remarks

Components of x must be greater than 0, otherwise the result for that component is undefined.
