Table of Contents

Class MathHelpers

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Minimal power-of-two test helpers.

public static class MathHelpers
Inheritance
MathHelpers
Inherited Members

Methods

IsPow2(int)

Whether x is a power of two. Returns true for 0.

public static bool IsPow2(int x)

Parameters

x int

The value to test.

Returns

bool

true if x has at most one bit set.

IsPow2(long)

Whether x is a power of two. Returns true for 0.

public static bool IsPow2(long x)

Parameters

x long

The value to test.

Returns

bool

true if x has at most one bit set.