# math.powerOfTwo

Function · category: Math

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/core/math/math.js#L194

```ts
powerOfTwo(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.powerOfTwo(32); // returns true
math.powerOfTwo(17); // returns false
```
