Previous Up Next

6.3.30  Folding sequences

The foldl (left-fold) and foldr (right-fold) commands take an infixed operator or function of two variables and apply them across a sequence of inputs through left and right association.

Examples

foldl('^',2,3,5)
     
32768           

which is equal to 2(35).

foldr('^',2,3,5)
     
847288609443           

which is equal to 3(52).


Previous Up Next