match method

bool match(
  1. List<num> other, {
  2. double precision = 1e-12,
})

Returns true if the inequality (this(i) - other(i)).abs() <= precision holds for each index i.

Implementation

bool match(List<num> other, {double precision = 1e-12}) {
  if (this == other) return true;
  if (length != other.length) return false;
  final it = iterator;
  final oit = other.iterator;
  while (it.moveNext() && oit.moveNext()) {
    if ((it.current - oit.current).abs() > precision) {
      return false;
    }
  }
  return true;
}