Stack sum and multiply operators for gmt/grdmath
|Target version:||Candidate for next minor release|
To avoid very long RPN expressions it would be handy to introduce an operator like SSUM, which would replace all items on the stack with their sum. E.g., instead of
gmt math 1 2 ADD 3 ADD 3 ADD 5 ADD 6 ADD = sum.txt
we could do
gmt math 1 2 3 4 5 6 SSUM = sum.txt
A similar SMUL could deliver the product of all items on the stack. Possible extensions would be SMEAN, SMED, SMODE which would deliver the stack mean, median, and mode values.