subtract static method

double subtract(
  1. Iterable<num> ns
)

Subtract in sequence ns entries.

Implementation

static double subtract(Iterable<num> ns) {
  if (ns.length <= 1) return 0;

  num? total;
  for (var n in ns) {
    if (total == null) {
      total = n;
    } else {
      total -= n;
    }
  }

  return total!.toDouble();
}