update how powers work

This commit is contained in:
2023-06-17 00:57:17 +01:00
parent 651830ec31
commit 63d7616053
15 changed files with 107 additions and 33 deletions

View File

@@ -1,3 +1,5 @@
import "csv" as csv
term.log(csv.read("tests/test.csv"))
let table = (csv.read("tests/test.csv"))
term.log(number(table[::-1][0][::-1][0]))

19
tests/diff.ar Normal file
View File

@@ -0,0 +1,19 @@
let zero = 1/infinity
let diff(f) = (x) = (f(x + zero) - f(x)) / zero
let count = 0
let f(x) = do
count = count + 1
term.log(count)
return x^10+x^9+x^8+x^7+x^6+x^5+x^4+x^3+x^2+x+1
x = 100
d = 0
forever do
n = f(x)
term.log("f"+("'"*d)+"("+x+") = "+n)
if (n == 0) break
f = diff(f)
d = d + 1
count = 0

View File

@@ -1,6 +1,6 @@
f() = do
a = []
for (i from 0 to 10000) a.append(i)
for (i from 0 to 100000) a.append(i)
term.log("start")
f()

View File

@@ -1,4 +1,4 @@
x = 10
let x = 10
do
let x = 20