# math.isPowerOfTwo

Function · category: Math

Source: https://github.com/playcanvas/engine/blob/64089771243fe28a9b9d2b4de538b99b07c75097/src/core/math/math.js#L196

```ts
isPowerOfTwo(x: number): boolean
```

Returns true if argument is a power-of-two and false otherwise.

**Parameters**

- `x` (`number`): Number to check for power-of-two property.

**Returns** `boolean`: true if power-of-two and false otherwise.

**Example**

```ts
math.isPowerOfTwo(32); // returns true
math.isPowerOfTwo(17); // returns false
```
