# IsPowerOfTwo(int)

> Returns true if the value is power of two.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static bool IsPowerOfTwo(int value)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        // prints false
        Debug.Log(Mathf.IsPowerOfTwo(7));

        // prints true
        Debug.Log(Mathf.IsPowerOfTwo(32));
    }
}
```
