UtilNearestPowerOf2 Method |
Round the value up to the nearest power of two.
Namespace: Demo3D.CommonAssembly: Demo3D.Common (in Demo3D.Common.dll) Version: 19.01.00
Syntaxpublic static int NearestPowerOf2(
int v
)
Parameters
- v Int32
- Value to round up.
Return Value
Int32The nearest power of two greater than or equal to supplied value.
RemarksThe results only make real sense if the v is in the range [1, 1073741823].
See Also