aboutsummaryrefslogtreecommitdiffstats
path: root/progs/bench/fib_iter.sy
blob: f82d6f8c8d094ae8bba70d5523933c4078c83d36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 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
    }
}