# ispow2

> Checks if the input is a power of two.

## Definition

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

## ispow2(int)

Checks if the input is a power of two.

```csharp
public static bool ispow2(int x)
```

### Parameters

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

### Returns

| Type                                                          | Description                                              |
| ------------------------------------------------------------- | -------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | bool where true indicates that input was a power of two. |

### Remarks

If x is less than or equal to zero, then this function returns false.

## ispow2(int2)

Checks if each component of the input is a power of two.

```csharp
public static bool2 ispow2(int2 x)
```

### Parameters

**** (\[int2]\(/engine/6000.6/script-reference/unity/mathematics/int2)): int2 input

### Returns

| Type                                                                | Description                                                                                   |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [bool2](/engine/6000.6/script-reference/unity/mathematics/bool2.md) | bool2 where true in a component indicates the same component in the input was a power of two. |

### Remarks

If a component of x is less than or equal to zero, then this function returns false in that component.

## ispow2(int3)

Checks if each component of the input is a power of two.

```csharp
public static bool3 ispow2(int3 x)
```

### Parameters

**** (\[int3]\(/engine/6000.6/script-reference/unity/mathematics/int3)): int3 input

### Returns

| Type                                                                | Description                                                                                   |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [bool3](/engine/6000.6/script-reference/unity/mathematics/bool3.md) | bool3 where true in a component indicates the same component in the input was a power of two. |

### Remarks

If a component of x is less than or equal to zero, then this function returns false in that component.

## ispow2(int4)

Checks if each component of the input is a power of two.

```csharp
public static bool4 ispow2(int4 x)
```

### Parameters

**** (\[int4]\(/engine/6000.6/script-reference/unity/mathematics/int4)): int4 input

### Returns

| Type                                                                | Description                                                                                   |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [bool4](/engine/6000.6/script-reference/unity/mathematics/bool4.md) | bool4 where true in a component indicates the same component in the input was a power of two. |

### Remarks

If a component of x is less than or equal to zero, then this function returns false in that component.

## ispow2(uint)

Checks if the input is a power of two.

```csharp
public static bool ispow2(uint x)
```

### Parameters

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

### Returns

| Type                                                          | Description                                              |
| ------------------------------------------------------------- | -------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | bool where true indicates that input was a power of two. |

### Remarks

If x is less than or equal to zero, then this function returns false.

## ispow2(uint2)

Checks if each component of the input is a power of two.

```csharp
public static bool2 ispow2(uint2 x)
```

### Parameters

**** (\[uint2]\(/engine/6000.6/script-reference/unity/mathematics/uint2)): uint2 input

### Returns

| Type                                                                | Description                                                                                   |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [bool2](/engine/6000.6/script-reference/unity/mathematics/bool2.md) | bool2 where true in a component indicates the same component in the input was a power of two. |

### Remarks

If a component of x is less than or equal to zero, then this function returns false in that component.

## ispow2(uint3)

Checks if each component of the input is a power of two.

```csharp
public static bool3 ispow2(uint3 x)
```

### Parameters

**** (\[uint3]\(/engine/6000.6/script-reference/unity/mathematics/uint3)): uint3 input

### Returns

| Type                                                                | Description                                                                                   |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [bool3](/engine/6000.6/script-reference/unity/mathematics/bool3.md) | bool3 where true in a component indicates the same component in the input was a power of two. |

### Remarks

If a component of x is less than or equal to zero, then this function returns false in that component.

## ispow2(uint4)

Checks if each component of the input is a power of two.

```csharp
public static bool4 ispow2(uint4 x)
```

### Parameters

**** (\[uint4]\(/engine/6000.6/script-reference/unity/mathematics/uint4)): uint4 input

### Returns

| Type                                                                | Description                                                                                   |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [bool4](/engine/6000.6/script-reference/unity/mathematics/bool4.md) | bool4 where true in a component indicates the same component in the input was a power of two. |

### Remarks

If a component of x is less than or equal to zero, then this function returns false in that component.
