separate number into float and integer

This commit is contained in:
Neemek 2026-07-07 23:24:44 +02:00
parent 10f55313b0
commit daab50d54c
Signed by: neemek
GPG key ID: 84FFE4D7D40AB25E
22 changed files with 848 additions and 428 deletions

View file

@ -1,20 +1,20 @@
list := []number
list := []int
x := 1
while x <= 1000 {
list.append(x)
assertEq(list.reduce(func(tot: number, a: number) number {
assertEq(list.reduce(fn(tot: int, a: int) -> int {
return tot + a
}, 0), x*(x + 1)/2)
x = x + 1
}
func sum(a: number, b: number) number {
fn sum(a: int, b: int) -> int {
return a + b
}
list = []number
list = []int
x = 1
while x <= 100 {
list.append(2*x - 1)