separate number into float and integer
This commit is contained in:
parent
10f55313b0
commit
daab50d54c
22 changed files with 848 additions and 428 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue