Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ceilpow2

Returns the smallest power of two greater than or equal to the input.
Read time 3 minutesLast updated 12 days ago

Definition

ceilpow2(int)

Returns the smallest power of two greater than or equal to the input.
public static int ceilpow2(int x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(int2)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.
public static int2 ceilpow2(int2 x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(int3)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.
public static int3 ceilpow2(int3 x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(int4)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.
public static int4 ceilpow2(int4 x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(uint)

Returns the smallest power of two greater than or equal to the input.
public static uint ceilpow2(uint x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(uint2)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.
public static uint2 ceilpow2(uint2 x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(uint3)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.
public static uint3 ceilpow2(uint3 x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(uint4)

Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input.
public static uint4 ceilpow2(uint4 x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(long)

Returns the smallest power of two greater than or equal to the input.
public static long ceilpow2(long x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.

ceilpow2(ulong)

Returns the smallest power of two greater than or equal to the input.
public static ulong ceilpow2(ulong x)

Parameters

Input value.

Returns

Type

Description

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

Remarks

Also known as nextpow2.