aboutsummaryrefslogtreecommitdiffstats
path: root/progs/bench/fib_iter.sy
blob: 7ed1021c3e2b2687d1082e4cd14802097c4516e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// A Fibonacci implementation that is a little
// less awful. But we run it 1000 times instead.
start :: fn {
    j := 0
    for , j < 1000, j = j + 1 {
        a := 0
        b := 1

        for i := 0, i < 50, i = i + 1 {
            c := a
            a = b
            b = c + b
        }
        a <=> 12586269025
    }
}

// flags: no_print