Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

math.ceilpow2

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static int ceilpow2(int x);

Parameters

Parameter Description
x Input value.

Returns

int The smallest power of two greater than or equal to the input.

Description

Returns the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static int2 ceilpow2(int2 x);

Parameters

Parameter Description
x Input value.

Returns

int2 The componentwise smallest power of two greater than or equal to the input.

Description

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static int3 ceilpow2(int3 x);

Parameters

Parameter Description
x Input value.

Returns

int3 The componentwise smallest power of two greater than or equal to the input.

Description

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static int4 ceilpow2(int4 x);

Parameters

Parameter Description
x Input value.

Returns

int4 The componentwise smallest power of two greater than or equal to the input.

Description

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static uint ceilpow2(uint x);

Parameters

Parameter Description
x Input value.

Returns

uint The smallest power of two greater than or equal to the input.

Description

Returns the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static uint2 ceilpow2(uint2 x);

Parameters

Parameter Description
x Input value.

Returns

uint2 The componentwise smallest power of two greater than or equal to the input.

Description

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static uint3 ceilpow2(uint3 x);

Parameters

Parameter Description
x Input value.

Returns

uint3 The componentwise smallest power of two greater than or equal to the input.

Description

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static uint4 ceilpow2(uint4 x);

Parameters

Parameter Description
x Input value.

Returns

uint4 The componentwise smallest power of two greater than or equal to the input.

Description

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static long ceilpow2(long x);

Parameters

Parameter Description
x Input value.

Returns

long The smallest power of two greater than or equal to the input.

Description

Returns the smallest power of two greater than or equal to the input.

Also known as nextpow2.


Declaration

public static ulong ceilpow2(ulong x);

Parameters

Parameter Description
x Input value.

Returns

ulong The smallest power of two greater than or equal to the input.

Description

Returns the smallest power of two greater than or equal to the input.

Also known as nextpow2.