Beispiel #1
0
            public void UInt64_ShouldReturnExpectedResult(ulong input, bool expected)
            {
                // Act
                bool actual = BinaryMath.IsPowerOfTwo(input);

                // Assert
                Assert.Equal(expected, actual);
            }
Beispiel #2
0
 /// <summary>
 /// Determines whether a value is a positive power of two.
 /// </summary>
 /// <param name="value">The value to test.</param>
 /// <returns><see langword="true"/> when <paramref name="value"/> is a positive power of two;
 /// otherwise, <see langword="false"/>.</returns>
 public static bool IsPowerOfTwo(int value)
 {
     return(BinaryMath.IsPowerOfTwo((long)value));
 }