Vyxapedia

Element - ¦ - Cumulative Sum

Characters: ¦


Description

Returns the sums of the prefixes of the top of the stack (cumulatively reduce by addition)


Overloads

  • any - cumulative_sum(a) ([a[0], a[0]+a[1], a[0]+a[1]+a[2], ...])

Examples

  • 12345 ¦ = ⟨1|3|6|10|15⟩
  • `abcdef` ¦ = ⟨`a`|`ab`|`abc`|`abcd`|`abcde`|`abcdef`⟩
  • `` ¦ = ⟨⟩
  • ⟨1|2|3|4|5⟩ ¦ = ⟨1|3|6|10|15⟩
  • ⟨⟩ ¦ = ⟨⟩