multiply static method

double multiply(
  1. Iterable<num> ns
)

Multiply in sequence ns entries.

Implementation

static double multiply(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();
}