Skip to main content
added 50 characters in body
Source Link
ubpdqn
  • 65.1k
  • 3
  • 65
  • 154

Using Min:

data = {-1050, 50, 1001, 1950, 1950, 1950, 525, 0};
FoldList[Min[#1 + #2, #2] &, data]

-> {-1050, -1000, 1, 1950, 1950, 1950, 525, 0}

Using Min:

data = {-1050, 50, 1001, 1950, 1950, 1950, 525, 0};
FoldList[Min[#1 + #2, #2] &, data]

Using Min:

data = {-1050, 50, 1001, 1950, 1950, 1950, 525, 0};
FoldList[Min[#1 + #2, #2] &, data]

-> {-1050, -1000, 1, 1950, 1950, 1950, 525, 0}

Source Link
ubpdqn
  • 65.1k
  • 3
  • 65
  • 154

Using Min:

data = {-1050, 50, 1001, 1950, 1950, 1950, 525, 0};
FoldList[Min[#1 + #2, #2] &, data]