acum {onemap}R Documentation

Cumulative sum

Description

Calculates the cumulative sum from 1 to w.

Usage

acum(w)

Arguments

w a non-negative integer

Value

Returns the cumulative sum 1+2+...+w, that is,

w*(w+1)/2,

for w >=q 0.

Note

Internally used by onemap - you probably do not need to use it directly.

Author(s)

Gabriel R A Margarido, gramarga@esalq.usp.br

Examples

acum(0) # 0

acum(4) # 1+2+3+4

[Package onemap version 0.1-1 Index]