MathExtensions.PowerOfTwoGreaterThanOrEqualTo Method

Definition

Overloads

PowerOfTwoGreaterThanOrEqualTo(Int32)

Get the value that is the next power of two at or after the input value.

PowerOfTwoGreaterThanOrEqualTo(Vector3Int)

For each component in a Vector3Int, get the component value that is the next power of two at or after the input component value.

PowerOfTwoGreaterThanOrEqualTo(Int32)

Get the value that is the next power of two at or after the input value.

public:
[System::Runtime::CompilerServices::Extension]
 static int PowerOfTwoGreaterThanOrEqualTo(int v);
public static int PowerOfTwoGreaterThanOrEqualTo (this int v);
public static int PowerOfTwoGreaterThanOrEqualTo (this int input);
static member PowerOfTwoGreaterThanOrEqualTo : int -> int
static member PowerOfTwoGreaterThanOrEqualTo : int -> int
<Extension()>
Public Function PowerOfTwoGreaterThanOrEqualTo (v As Integer) As Integer
<Extension()>
Public Function PowerOfTwoGreaterThanOrEqualTo (input As Integer) As Integer

Parameters

vinput
Int32

Returns

If the input value is a power of two, the input value is returned. Otherwise the next power of two, after the input value, is returned.

Applies to

PowerOfTwoGreaterThanOrEqualTo(Vector3Int)

For each component in a Vector3Int, get the component value that is the next power of two at or after the input component value.

public:
[System::Runtime::CompilerServices::Extension]
 static UnityEngine::Vector3Int PowerOfTwoGreaterThanOrEqualTo(UnityEngine::Vector3Int v);
public static UnityEngine.Vector3Int PowerOfTwoGreaterThanOrEqualTo (this UnityEngine.Vector3Int v);
public static UnityEngine.Vector3Int PowerOfTwoGreaterThanOrEqualTo (this UnityEngine.Vector3Int inputVector);
static member PowerOfTwoGreaterThanOrEqualTo : UnityEngine.Vector3Int -> UnityEngine.Vector3Int
static member PowerOfTwoGreaterThanOrEqualTo : UnityEngine.Vector3Int -> UnityEngine.Vector3Int
<Extension()>
Public Function PowerOfTwoGreaterThanOrEqualTo (v As Vector3Int) As Vector3Int
<Extension()>
Public Function PowerOfTwoGreaterThanOrEqualTo (inputVector As Vector3Int) As Vector3Int

Parameters

vinputVector
UnityEngine.Vector3Int

Returns

UnityEngine.Vector3Int

A Vector3Int containing components that are a power of two. If an input's component value is a power of two, than that component value is in the returned in the corresponding vector position. Otherwise the next power of two, after the component value, is returned in the corresponding vector position.

Applies to