I have to following code:
BitArray arr1 = new BitArray(200);BitArray arr2 = new BitArray(200);arr1[2] = true;arr2[2] = true;if (arr1.And(arr2) == arr2) Console.WriteLine("good");else Console.WriteLine("bad");
It returns "bad" for some unknown reason. My guess is that Equals implemented a reference comparison and not bitwise comparison.It seems like a strange behavior as BitArray is classic for bitwise operations on it.Am I missing something?
update: I've refactored Microsoft orginal BitArray and named it BitArray2. You can find it here.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Oren Ellenbogen
<= Contact me via E-mail
newtelligence dasBlog 2.2.8279.16125