Table of Contents

Class MathExt

Namespace
TCSystem.Util
Assembly
TCSystem.Util.dll

Provides integer mathematics helpers.

public static class MathExt
Inheritance
MathExt
Inherited Members

Methods

ToNextPowerOf2(int)

Rounds a non-negative integer up to the next power of two.

public static int ToNextPowerOf2(this int x)

Parameters

x int

The value to round.

Returns

int

The next power of two; zero for negative values and for overflow beyond the positive int range.