summaryrefslogtreecommitdiff
path: root/stdlib/math.pcdt
blob: e4b0fe065377fd1df5964a2512f6ebe184f74769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
store(
  ref((
    store(0; last;)
    if(not(eq(arg0() 1;))
      (
        update(multiply(sub(arg0() 1;) arg1()) last;)
      )
    )
    sum(arg1() last())
  ))
  multiply;
)