C# BigInteger IsPowerOfTwo
Description
BigInteger IsPowerOfTwo
Indicates whether the value
of the current BigInteger object is a power of two.
Syntax
BigInteger.IsPowerOfTwo
has the following syntax.
public bool IsPowerOfTwo { get; }
Example
using System;// w w w. j a v a2 s . co m
using System.Numerics;
public class Example
{
public static void Main()
{
BigInteger b = BigInteger.Pow(Int64.MaxValue, 2);
Console.WriteLine(b.IsPowerOfTwo);
}
}
The code above generates the following result.