summaryrefslogtreecommitdiff
path: root/stdlib/math.pcdt
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-02-17 21:07:35 -0800
committerKai Stevenson <kai@kaistevenson.com>2023-02-17 21:12:26 -0800
commit42696cdb053d994eacfc66bb348b0ddf0d80046c (patch)
tree105c9e6a746e25cc64df6aef61bf93f6f8713d28 /stdlib/math.pcdt
parentdab73c05a0c4529bd26410beae0868ec2ff570c2 (diff)
added update() function, added multiply() function to stdlib
Diffstat (limited to 'stdlib/math.pcdt')
-rw-r--r--stdlib/math.pcdt12
1 files changed, 12 insertions, 0 deletions
diff --git a/stdlib/math.pcdt b/stdlib/math.pcdt
new file mode 100644
index 0000000..078045d
--- /dev/null
+++ b/stdlib/math.pcdt
@@ -0,0 +1,12 @@
+store(
+ (
+ store(0; last;)
+ if(not(eq(arg0() 1;))
+ (
+ update(multiply(sub(arg0() 1;) arg1()) last;)
+ )
+ )
+ sum(arg1() last())
+ )
+ multiply;
+)