Product

library operator
ID: b32235c4-4475-44db-8ded-28a7c2091c8f
Emits the product of a stream of numbers.

Behavior

Test data showing the behavior of Product

Integers

It emits the product of integers by multiplying all of them.

Input Output
[1,2,3,4] 24
[12,9,4] 432
Empty

It emits 1 if the input stream is empty.

Input Output
[] 1
Floats

It emits the product of floats by multiplying all of them.

Input Output
[1.5,3.5,2.5] 13.125

Implementation

The implementation of Product makes use of the following 2 operators.

1
Reduces the items of a stream pairwise using a reducer delegate.
1
Multiplies two numbers A and B and emits their product.