INNER CODE UNIT · Dart

xor

Ephenodrom/Dart-Basic-Utils · lib/src/BooleanUtils.dart:50

  static bool xor(final List<bool> array) {
    // false if the neutral element of the xor operator
    var result = false;
    for (final element in array) {
      result ^= element;
    }

    return result;
  }

  /// Returns a new list of possible values (like an enum would).
  static List<bool> booleanValues() {
    return [false, true];
  }

  /// Compares two boolean values
  static int compare(final bool x, final bool y) {
    if (x == y) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…