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

math.ceillog2

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 ceillog2(int x);

Parameters

Parameter Description
x Integer to be used as input.

Returns

int Ceiling of the base-2 logarithm of x, as an integer.

Description

Computes the ceiling of the base-2 logarithm of x.

x must be greater than 0, otherwise the result is undefined.


Declaration

public static int2 ceillog2(int2 x);

Parameters

Parameter Description
x int2 to be used as input.

Returns

int2 Componentwise ceiling of the base-2 logarithm of x.

Description

Computes the componentwise ceiling of the base-2 logarithm of x.

Components of x must be greater than 0, otherwise the result for that component is undefined.


Declaration

public static int3 ceillog2(int3 x);

Parameters

Parameter Description
x int3 to be used as input.

Returns

int3 Componentwise ceiling of the base-2 logarithm of x.

Description

Computes the componentwise ceiling of the base-2 logarithm of x.

Components of x must be greater than 0, otherwise the result for that component is undefined.


Declaration

public static int4 ceillog2(int4 x);

Parameters

Parameter Description
x int4 to be used as input.

Returns

int4 Componentwise ceiling of the base-2 logarithm of x.

Description

Computes the componentwise ceiling of the base-2 logarithm of x.

Components of x must be greater than 0, otherwise the result for that component is undefined.


Declaration

public static int ceillog2(uint x);

Parameters

Parameter Description
x Unsigned integer to be used as input.

Returns

int Ceiling of the base-2 logarithm of x, as an integer.

Description

Computes the ceiling of the base-2 logarithm of x.

x must be greater than 0, otherwise the result is undefined.


Declaration

public static int2 ceillog2(uint2 x);

Parameters

Parameter Description
x uint2 to be used as input.

Returns

int2 Componentwise ceiling of the base-2 logarithm of x.

Description

Computes the componentwise ceiling of the base-2 logarithm of x.

Components of x must be greater than 0, otherwise the result for that component is undefined.


Declaration

public static int3 ceillog2(uint3 x);

Parameters

Parameter Description
x uint3 to be used as input.

Returns

int3 Componentwise ceiling of the base-2 logarithm of x.

Description

Computes the componentwise ceiling of the base-2 logarithm of x.

Components of x must be greater than 0, otherwise the result for that component is undefined.


Declaration

public static int4 ceillog2(uint4 x);

Parameters

Parameter Description
x uint4 to be used as input.

Returns

int4 Componentwise ceiling of the base-2 logarithm of x.

Description

Computes the componentwise ceiling of the base-2 logarithm of x.

Components of x must be greater than 0, otherwise the result for that component is undefined.