/// <summary> /// Returns a bool2 from component-wise application of Or (lhs || rhs). /// </summary> public static bool2 Or(bool lhs, bool2 rhs) => new bool2(lhs || rhs.x, lhs || rhs.y);
/// <summary> /// Returns a bool2 from component-wise application of Nor (!(lhs || rhs)). /// </summary> public static bool2 Nor(bool2 lhs, bool rhs) => new bool2(!(lhs.x || rhs), !(lhs.y || rhs));
/// <summary> /// Returns a bool2 from component-wise application of Nand (!(lhs && rhs)). /// </summary> public static bool2 Nand(bool lhs, bool2 rhs) => new bool2(!(lhs && rhs.x), !(lhs && rhs.y));
/// <summary> /// Returns a bool2 from component-wise application of Or (lhs || rhs). /// </summary> public static bool2 Or(bool2 lhs, bool rhs) => new bool2(lhs.x || rhs, lhs.y || rhs);
/// <summary> /// Tries to convert the string representation of the vector into a vector representation (using ', ' as a separator), returns false if string was invalid. /// </summary> public static bool TryParse(string s, out bool2 result) => TryParse(s, ", ", out result);
/// <summary> /// Returns a bool2 from component-wise application of Nand (!(lhs && rhs)). /// </summary> public static bool2 Nand(bool2 lhs, bool rhs) => new bool2(!(lhs.x && rhs), !(lhs.y && rhs));
/// <summary> /// Returns a bool2 from component-wise application of And (lhs && rhs). /// </summary> public static bool2 And(bool2 lhs, bool rhs) => new bool2(lhs.x && rhs, lhs.y && rhs);
/// <summary> /// Returns a bool2 from component-wise application of Xnor (lhs == rhs). /// </summary> public static bool2 Xnor(bool2 lhs, bool rhs) => new bool2(lhs.x == rhs, lhs.y == rhs);
/// <summary> /// Returns a bool2 from component-wise application of NotEqual (lhs != rhs). /// </summary> public static bool2 NotEqual(bool lhs, bool2 rhs) => new bool2(lhs != rhs.x, lhs != rhs.y);
/// <summary> /// Returns a bool2 from component-wise application of Not (!v). /// </summary> public static bool2 Not(bool2 v) => new bool2(!v.x, !v.y);
/// <summary> /// Returns a bool2 from component-wise application of NotEqual (lhs != rhs). /// </summary> public static bool2 NotEqual(bool2 lhs, bool rhs) => new bool2(lhs.x != rhs, lhs.y != rhs);
/// <summary> /// Returns a bool2 from component-wise application of Equal (lhs == rhs). /// </summary> public static bool2 Equal(bool lhs, bool2 rhs) => new bool2(lhs == rhs.x, lhs == rhs.y);
/// <summary> /// Returns a bool2 from component-wise application of Equal (lhs == rhs). /// </summary> public static bool2 Equal(bool2 lhs, bool rhs) => new bool2(lhs.x == rhs, lhs.y == rhs);
/// <summary> /// Returns a bool2 from component-wise application of Nor (!(lhs || rhs)). /// </summary> public static bool2 Nor(bool lhs, bool2 rhs) => new bool2(!(lhs || rhs.x), !(lhs || rhs.y));
/// <summary> /// Returns a bool2 from component-wise application of And (lhs && rhs). /// </summary> public static bool2 And(bool lhs, bool2 rhs) => new bool2(lhs && rhs.x, lhs && rhs.y);
/// <summary> /// Returns a bool2 from component-wise application of Xor (lhs != rhs). /// </summary> public static bool2 Xor(bool2 lhs, bool rhs) => new bool2(lhs.x != rhs, lhs.y != rhs);
/// <summary> /// from-vector constructor /// </summary> public bool2(bool2 v) { this.x = v.x; this.y = v.y; }
/// <summary> /// Returns a bool2 from component-wise application of Xnor (lhs == rhs). /// </summary> public static bool2 Xnor(bool lhs, bool2 rhs) => new bool2(lhs == rhs.x, lhs == rhs.y);
/// <summary> /// Returns true iff this equals rhs component-wise. /// </summary> public bool Equals(bool2 rhs) => (x.Equals(rhs.x) && y.Equals(rhs.y));