INNER CODE UNIT · Dart

or

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

  static bool or(final List<bool> array) {
    for (final element in array) {
      if (element) {
        return true;
      }
    }
    return false;
  }

  /// Performs an xor on a set of booleans.
  ///
  ///   BooleanUtils.xor([true, true])   = false
  ///   BooleanUtils.xor([false, false]) = false
  ///   BooleanUtils.xor([true, false])  = true
  static bool xor(final List<bool> array) {
    // false if the neutral element of the xor operator
    var result = false;
    for (final element in array) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…