Gemstone Common Library
Show/Hide TOC

# BitMathIsPowerOfTwo(UInt32) Method

Determines if the number is a power of 2.

## Definition

Namespace: Gemstone
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.150 -- Release Build+64e3b411e1abfbd2d4d8a81e850c3909a0ce8731
C#
View Source Request Example

    public static bool IsPowerOfTwo(
    	uint value
    )

VB
View Source Request Example

    Public Shared Function IsPowerOfTwo (
    	value As UInteger
    ) As Boolean

C++
View Source Request Example

    public:
    static bool IsPowerOfTwo(
    	unsigned int value
    )

JavaScript
View Source Request Example

    Gemstone.BitMath.IsPowerOfTwo = function(value);

#### Parameters

value UInt32
  The value to check power of two properties.

#### Return Value

Boolean
true if value is a power of 2; otherwise, false.

## See Also

#### Reference

BitMath Class
IsPowerOfTwo Overload
Gemstone Namespace