Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IsPowerOfTwo

bool System.Numerics.BigInteger.IsPowerOfTwo
get

Definition at line 38 of file BigInteger.cs.

39 {
40 get
41 {
42 if (_bits == null)
43 {
44 if ((_sign & (_sign - 1)) == 0)
45 {
46 return _sign != 0;
47 }
48 return false;
49 }
50 if (_sign != 1)
51 {
52 return false;
53 }
54 int num = _bits.Length - 1;
55 if ((_bits[num] & (_bits[num] - 1)) != 0)
56 {
57 return false;
58 }
59 while (--num >= 0)
60 {
61 if (_bits[num] != 0)
62 {
63 return false;
64 }
65 }
66 return true;
67 }
68 }
readonly uint[] _bits
Definition BigInteger.cs:20