Tests to see if TestValue is a (integer) power of PowerOf.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public static bool IsPowerOf( int PowerOf, int TestValue )
Public Shared Function IsPowerOf ( _ PowerOf As Integer, _ TestValue As Integer _ ) As Boolean
public: static bool IsPowerOf( int PowerOf, int TestValue )
Parameters
- PowerOf (Int32)
- Number to raise to integer powers.
- TestValue (Int32)
- Value to test to see if it is an integer power
Return Value
True if TestValue is a power of PowerOf.
Examples
If PowerOf = 2, then this function returns true if TestValue is
1, 2, 4, 8, 16,...