public static void Main() { var bitsArray = new BitArray64(128); Console.WriteLine("Bits: {0}", bitsArray); Console.WriteLine("Value: {0}\n", bitsArray.Value); // change index in array bitsArray[30] = 1; Console.WriteLine("Bits: {0}", bitsArray); Console.WriteLine("Value: {0}\n", bitsArray.Value); Console.Write("Bits: "); var maxArray = new BitArray64(ulong.MaxValue); foreach (var bit in maxArray) { Console.Write(bit); } Console.WriteLine(); Console.WriteLine("Value: {0}\n", maxArray.Value); var newArray = new BitArray64(32); Console.WriteLine(bitsArray.Equals(newArray)); Console.WriteLine(newArray != bitsArray); }
public override bool Equals(object obj) { BitArray64 other = obj as BitArray64; if (other == null) { return(false); } return(this.number == other.number); }
public override bool Equals(object obj) { var arrayAsObj = obj as BitArray64; if ((object)arrayAsObj == null) { return(false); } return(BitArray64.Equals(this.value, arrayAsObj.value)); }
public static bool operator !=(BitArray64 first, BitArray64 second) { return(!BitArray64.Equals(first, second)); }