Click or drag to resize

UtilNearestPowerOf2 Method

Round the value up to the nearest power of two.

Namespace:  Demo3D.Common
Assembly:  Demo3D.Common (in Demo3D.Common.dll) Version: 15.0.2.11458
Syntax
C#
public static int NearestPowerOf2(
	int v
)

Parameters

v
Type: SystemInt32
Value to round up.

Return Value

Type: Int32
The nearest power of two greater than or equal to supplied value.
Remarks
The results only make real sense if the v is in the range [1, 1073741823].
See Also