Method PowerOf2Ceil
PowerOf2Ceil(int)
Rounds a number to the next closest power of 2.
Declaration
public static int PowerOf2Ceil(int num)
Parameters
| Type | Name | Description |
|---|---|---|
| int | num | Positive number. |
Returns
| Type | Description |
|---|---|
| int | The lower power of 2 that is greater than num. Returns 1 if num is not greater than 0. |
PowerOf2Ceil(uint)
Rounds a number to the next closest power of 2.
Declaration
public static uint PowerOf2Ceil(uint num)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | num | Positive number. |
Returns
| Type | Description |
|---|---|
| uint | The lower power of 2 that is greater than num. Returns 1 if the num is 0. |