aboutsummaryrefslogblamecommitdiffstats
path: root/src/VMTestsFiller/performanceTester.sol
blob: 3b1202ceafafbc38ff08a0f760ed76fbe88c1099 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                             
contract PerformanceTester {    
    function ackermann(uint m, uint n) returns (uint) {
        if (m == 0)
            return n + 1;
        
        if (n == 0)
            return ackermann(m - 1, 1);
        
        return ackermann(m - 1, ackermann(m, n - 1));
    }
    
    function fibonacci(uint n) returns (uint) {
        if (n == 0 || n == 1)
            return n;
        return fibonacci(n - 1) + fibonacci(n - 2);
    }
}