3 ms·
This looks even more natural from the programmer’s standpoint: reduction of a set of numbers by summation starts with 0, and reduction by multiplication, with 1
by Koshkin 6y ago
This looks even more natural from the programmer’s standpoint: reduction of a set of numbers by summation starts with 0, and reduction by multiplication, with 1; so, if the set is empty (has zero elements) the result is simply the starting number (0 or 1, respectively).
- _0ffh 6y agoAnd so in general the reduction of an empty list should always the neutral element of the operator.