Loading

reducer.product


reducer
Since v1.0.11
Available on all platforms
See also

This reducer function computes the product of all the values for each tick.

The reducer.product function can only be applied to values of type LONG or DOUBLE, it will produce no value for types STRING and BOOLEAN.

Warning : with LONG values, computation can silently overflow.

Signature

Examples

[ NEWGTS "GTS1" RENAME 10 42.0 42.0 42.0 1.0 ADDVALUE //for tick 10, there is lat/long/elevation 20 NaN NaN NaN 5.0 ADDVALUE //for tick 20, the first GTS has no lat/long/elevation NEWGTS "GTS2" RENAME 10 NaN NaN NaN -4.0 ADDVALUE 20 44.0 44.0 44.0 3.0 ADDVALUE NEWGTS "GTS3" RENAME 10 NaN NaN NaN -3.0 ADDVALUE 20 NaN NaN NaN 8.0 ADDVALUE NEWGTS "GTS4" RENAME 10 NaN NaN NaN 3.0 ADDVALUE 30 NaN NaN NaN -2.0 ADDVALUE //tick 10 : 1*-4*-3*3 => 36 //tick 20 : 5*3*8 => 120 //tick 30 : 2 => -2 ] 'GTSlist' STORE [ $GTSlist [] reducer.product ] REDUCE