floorlog2
Computes the floor of the base-2 logarithm of x.
Read time 2 minutesLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
floorlog2(int)
Computes the floor of the base-2 logarithm of x.
public static int floorlog2(int x)
Parameters
Integer to be used as input.
Returns
Type | Description |
|---|---|
| int | Floor of base-2 logarithm of x. |
Remarks
x must be greater than zero, otherwise the result is undefined.
floorlog2(int2)
Computes the componentwise floor of the base-2 logarithm of x.
public static int2 floorlog2(int2 x)
Parameters
int2 to be used as input.
Returns
Type | Description |
|---|---|
| int2 | Componentwise floor of base-2 logarithm of x. |
Remarks
Components of x must be greater than zero, otherwise the result of the component is undefined.
floorlog2(int3)
Computes the componentwise floor of the base-2 logarithm of x.
public static int3 floorlog2(int3 x)
Parameters
int3 to be used as input.
Returns
Type | Description |
|---|---|
| int3 | Componentwise floor of base-2 logarithm of x. |
Remarks
Components of x must be greater than zero, otherwise the result of the component is undefined.
floorlog2(int4)
Computes the componentwise floor of the base-2 logarithm of x.
public static int4 floorlog2(int4 x)
Parameters
int4 to be used as input.
Returns
Type | Description |
|---|---|
| int4 | Componentwise floor of base-2 logarithm of x. |
Remarks
Components of x must be greater than zero, otherwise the result of the component is undefined.
floorlog2(uint)
Computes the floor of the base-2 logarithm of x.
public static int floorlog2(uint x)
Parameters
Unsigned integer to be used as input.
Returns
Type | Description |
|---|---|
| int | Floor of base-2 logarithm of x. |
Remarks
x must be greater than zero, otherwise the result is undefined.
floorlog2(uint2)
Computes the componentwise floor of the base-2 logarithm of x.
public static int2 floorlog2(uint2 x)
Parameters
uint2 to be used as input.
Returns
Type | Description |
|---|---|
| int2 | Componentwise floor of base-2 logarithm of x. |
Remarks
Components of x must be greater than zero, otherwise the result of the component is undefined.
floorlog2(uint3)
Computes the componentwise floor of the base-2 logarithm of x.
public static int3 floorlog2(uint3 x)
Parameters
uint3 to be used as input.
Returns
Type | Description |
|---|---|
| int3 | Componentwise floor of base-2 logarithm of x. |
Remarks
Components of x must be greater than zero, otherwise the result of the component is undefined.
floorlog2(uint4)
Computes the componentwise floor of the base-2 logarithm of x.
public static int4 floorlog2(uint4 x)
Parameters
uint4 to be used as input.
Returns
Type | Description |
|---|---|
| int4 | Componentwise floor of base-2 logarithm of x. |
Remarks
Components of x must be greater than zero, otherwise the result of the component is undefined.