/// <summary> /// Ensure that all provided flags are on or off /// </summary> /// <param name="flag">Set of values to modify</param> /// <param name="on">True to turn on and False to clear</param> /// <returns></returns> protected bool Flag(BigBitBlob flag, bool on) { if (Max != flag?.Max) { return(false); } Blob = (on) ? NumberEx.Or(Blob, flag.Blob, false) : NumberEx.And(Blob, NumberEx.Complement(flag.Blob, true)); return(true); }
public static BigBitBlob operator ~(BigBitBlob a) { return((a == null) ? null : new BigBitBlob(a.Max, false, NumberEx.Complement(a.Blob, true))); }