cumsum(x) cumprod(x)
These are members of the Math group of generic functions.
The cumprod function performs arithmetic in double precision even if x has integer storage mode.
cumsum(1:6) # returns c(1, 3, 6, 10, 15, 21)cumprod(1:6) # returns c(1, 2, 6, 24, 96, 576)